Reputation: 1
I am using proxies rotating and sometimes it could happen one of these randomly doesn't work and I get "ERR_TIMED_OUT"
enable to reach server and script just crashed without continuing, is it possible to refresh the webpage automatically in silenium when this happens (so the proxy will rotate). I thought about catch exception putting then driver.refresh()
but how can I catch into the entire code without try- except for every instruction? is there another solution? thanks!
Upvotes: 0
Views: 392
Reputation: 395
You can use event_firing_webdriver: https://www.selenium.dev/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.event_firing_webdriver.html
you can decorate method get() and execute try except there (with refresh on timeout exception).
Upvotes: 1