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.

Revisions

  1. @spirkaa spirkaa created this gist Dec 11, 2014.
    5 changes: 5 additions & 0 deletions Selenium Requests download image
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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)