Python+Selenium练习(十)-刷新当前页面

刷新页面方法

具体代码:

# coding=utf-8
import time
from selenium import webdriver

driver = webdriver.Chrome()
driver.maximize_window()
driver.implicitly_wait(6)

driver.get("https://www.baidu.com")
time.sleep(2)

try:
    driver.refresh()
    print('test pass :refresh successful')
except Exception as e:
    print("Exception found",format(e))

driver.quit()

 

参考文章:https://blog.csdn.net/u011541946/article/details/68927515

posted @ 2020-04-02 22:59  哔仙女  阅读(2571)  评论(0编辑  收藏  举报