Home > Net >  Chrome Webdriver Refresh does not respond since Chrome 106
Chrome Webdriver Refresh does not respond since Chrome 106

Time:10-31

Since I have upgraded to Chrome 106 (and now to 107) the driver manages to open the URL at the first time but after some timeout (?) or other criteria, the driver.refresh() does not return (i.e. no resposne). The way it looks to me, if the Refresh occurs within seconds since the initial open, then the refresh succeeds. Yet, if longer interval has elapsed since the initial open, then the refresh() does not complete. Code is in Python.

Before version 106 this seemed to work well

Does anyone experience similar behaviour? Any idea how to fix that?

#Code to create the driver:
    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument("--disable-blink-features")
    chrome_options.add_argument("--disable-blink-features=AutomationControlled")
    driver = webdriver.Chrome(r'...  \chromedriver', options=chrome_options)`

#Then, the attempt to refresh: 
    driver.refresh()

Expecting the webpage to refresh

CodePudding user response:

if your work does not depend much on it, just use earlier versions where it used to work.

if not, try the following: driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND 'r')

CodePudding user response:

Can you do it on google colab? try this

import sys sys.path.insert(0,'/usr/lib/chromium-browser/chromedriver')
from selenium import webdriver 
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless') 
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage') 
driver = webdriver.Chrome('chromedriver',options=chrome_options)
driver.get(url)
  • Related