如何在Python Selenium WebDriver中无限循环URL?我试过time.sleep driver.refresh(),但效率不高。
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
import os
import time
chromedriver = "chromedriver.exe"
driver = webdriver.Chrome()
driver.get("http://www.example.com/load")
答案 0 :(得分:1)
from selenium import webdriver
driver = webdriver.Chrome()
driver.maximize_window()
print "To quit the program, please kill the program or close browser"
while True:
driver.get("http://www.bbc.com/")
这将有助于解决您的问题