Python Forum
Parsing html page and working with checkbox (on a captcha)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parsing html page and working with checkbox (on a captcha)
#9
(Jan-26-2021, 08:44 PM)snippsat Wrote: Take a look at this post.
So it can work similar when a new window show most switch with browser.switch_to.frame(0).
Then can find element and click and throw in a time.sleep(3) to behave like human.
I have not tested i'm a not robot captcha yet,just some tough on what i would tried first.

Thank you.
About problem 2.
I suppose switch_to.frame(0) is not needed, because I selected (finded) other elements successfully. The main problem for me is how to find captcha checkbox and what should I find - "recaptcha-checkbox-checkmark" or other (see captcha.jpg)?
Here is different finds with errors:
v1. elem_capt = driver.find_element_by_id("recaptcha-checkbox-checkmark")
elem_capt.select()
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="recaptcha-checkbox-checkmark"]"}

v2. elem_capt = driver.find_element_by_class_name("recaptcha-checkbox-checkmark")
elem_capt.select()
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".recaptcha-checkbox-checkmark"}

v3. elem_capt = driver.find_elements_by_css_selector("recaptcha-checkbox-checkmark")
elem_capt.select()
AttributeError: 'list' object has no attribute 'select'

v3 looks preferable, but how to choose what I need from this 'list' to 'select'?
Unfortunately "print(len(elem_capt))" prints '0'

So if I write
elem_capt = driver.find_elements_by_css_selector("recaptcha-checkbox-checkmark")[0]
I got IndexError: list index out of range

- - -
Additionally, I would like to note that problem 1 is still not resolved.
Reply


Messages In This Thread
RE: Parsing html page and working with checkbox (on a captcha) - by straannick - Jan-27-2021, 11:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo Disable checkbox of google maps markers/labels using selenium erickkill 0 1,305 Nov-25-2021, 12:20 PM
Last Post: erickkill
  <title> django page title dynamic and other field (not working) lemonred 1 2,153 Nov-04-2021, 08:50 PM
Last Post: lemonred
  Automating Captcha form submission with Mechanize Dexty 2 3,364 Aug-03-2021, 01:02 PM
Last Post: Dexty
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,742 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Saving html page and reloading into selenium while developing all xpaths Larz60+ 4 4,271 Feb-04-2021, 07:01 AM
Last Post: jonathanwhite1
  API auto-refresh on HTML page using Flask toc 2 11,959 Dec-23-2020, 02:00 PM
Last Post: toc
  Selenium Parsing (unable to Parse page after loading) oneclick 7 6,135 Oct-30-2020, 08:13 PM
Last Post: tomalex
  Help: Beautiful Soup - Parsing HTML table ironfelix717 2 2,762 Oct-01-2020, 02:19 PM
Last Post: snippsat
  [FLASK] checkbox onclick event Mad0ck 2 4,961 May-14-2020, 09:35 AM
Last Post: Mad0ck
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,412 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020