1

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

Federico
  • 13
  • 3
  • Just a tip, is best not to use `os.system("command --help")` and use `subprocess.run(["command, "--help"])` instead. Source: https://stackoverflow.com/a/89243/9215267 – Siddharth Dushantha Feb 02 '20 at 08:23

0 Answers0