I made a python script in order to scrape some google search results but after a while google obviously send me captcha.
I tried to workaround by disconnecting and reconnecting Wi-Fi and then start again with google search with the following code:
driver.quit()
os.system("networksetup -setairportpower airport off")
sleep(20)
os.system("networksetup -setairportpower airport on")
sleep(20)
driver = webdriver.Chrome("/Users/fede/PycharmProjects/web_scraping-master/chromedriver")
sleep(20)
In the 20 seconds system is sleeping after Wi-Fi reconnect ExpressVPN is able to connect again to network.
The problem is that if I do this procedure by hand it works but if I use the script that follow the same steps it doesn’t. Do you have any suggestion? Thanks
Federico