Jan-27-2021, 11:27 AM
(This post was last modified: Jan-27-2021, 11:27 AM by straannick.)
(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 withbrowser.switch_to.frame(0)
.
Then can find element and click and throw in atime.sleep(3)
to behave like human.
I have not testedi'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.