I have a question. Why the refresh is not stop when I got the url.
The refresh is still running when I got the url.
Thank you all.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
from selenium.common.exceptions import NoSuchElementException
PATH = C:// location of webdriver
driver = webdriver.Chrome(PATH)
url = '1'
driver.get(url)
print(url)
while True:
if '2' in url:
try:
driver.get('1')
print('done')
except:
break
while True:
if driver.get('1'):
print('done')
break
else:
time.sleep(1)
driver.refresh()
print('try to reload')
with webdriver.Chrome() as driver:
driver.get('https://www.google.com/')
while True:
if driver.get('https://www.google.com/'):
print('done')
break
else:
time.sleep(1)
driver.refresh
print('try to reload')
I made the example through google, I don't know why I get the website of google , it is still refreshing. Thanks