简体   繁体   中英

How to periodically relogin with selenium Python?

The site i'am scraping shows an exception every almost 20 minutes 'the session is expired because of inactivity '
Is there a way to fix that?

The simplest solution is to click on some element on the page or perform some action with Actions class, like hovering over some sensitive element or even refresh the page.

There are multiple ways of refreshing a page in Selenium, I think the most used way of refreshing a webpage is with this command.

driver.navigate().refresh();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM