0

How can i loop a URL infinitely in Python Selenium WebDriver? I have tried time.sleep driver.refresh() but it is not very efficient.

    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")
1

1 Answer 1

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/")

This will help to solve your problem

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.