Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save davidas13/9d510f23d4ba86202abb8022894a0a3d to your computer and use it in GitHub Desktop.

Select an option

Save davidas13/9d510f23d4ba86202abb8022894a0a3d to your computer and use it in GitHub Desktop.
How to download captcha image with Python Selenium and Requests
img = driver.find_element_by_xpath("//div[@id='MailRuConfirm']/div/div[18]/form/div[1]/div[2]/div[2]/div[2]/img")
src = img.get_attribute('src')
img = requests.get(src)
with open('captcha.jpg', 'wb') as f:
f.write(img.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment