使用 Selenium 库和 Python 脚本可以在浏览器中模拟用户操作,包括刷新页面和回退页面。
刷新页面:
from selenium import webdriver
# 创建浏览器对象
browser = webdriver.Firefox()
# 访问页面
browser.get("http://www.example.com")
# 刷新页面
browser.refresh()
使用 Selenium 库和 Python 脚本可以在浏览器中模拟用户操作,包括刷新页面和回退页面。
刷新页面:
from selenium import webdriver
# 创建浏览器对象
browser = webdriver.Firefox()
# 访问页面
browser.get("http://www.example.com")
# 刷新页面
browser.refresh()