How to refresh an already opened web page

I would suggest binding the driver element search to the tag body and use the refresh command of the browser.

In OSX for example

driver.find_element_by_tag_name('body').send_keys(Keys.COMMAND + 'r')

Documentation on keys here:

The following code, very similar to your one, works fine for me.

    driver = webdriver.Firefox()
    driver.get(response.url) #tested in combination with scrapy   

Are you sure you correctly load the web page with the driver before refreshing it ?

Leave a Comment