Skip to content

[Question] Check if element exists fails  #437

@sla-te

Description

@sla-te

https://patrickhlauke.github.io/recaptcha/ Im trying to determine whether or not the recaptcha container exists.

I tried:

page.waitForSelector(text="I'm not a robot")
and
x_frame = page.frame(name="name_of_frame"); x_frame.waitForSelector("text=I'm not a robot")
page.waitForSelector("css=.g-recaptcha", timeout=1, state="attached") also fails

Ultimately solved it by:

is_captcha_required = False
for frame in self.page.frames:
    if 'not a robot' in frame.content():
        is_captcha_required = True
        break

but i dont consider that clean

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions