Advertisement
dereksir

Untitled

Feb 13th, 2024 (edited)
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. #..
  2.     # inject the solved CAPTCHA solution into the page and click Submit button
  3.     await page.evaluate('''(solution) => {
  4.        document.getElementById('g-recaptcha-response').innerHTML = solution;        
  5.    }''', solution)
  6.  
  7.     # Click the submit button
  8.     await page.click('#recaptcha-demo-submit')
  9.  
  10.     # take screenshot
  11.     await page.screenshot({'path': 'solved.png'})
  12.  
  13.     # Close the browser
  14.     await browser.close()
  15.  
  16. asyncio.get_event_loop().run_until_complete(main())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement