Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

The playwright-python is clickable but nothing happen

$
0
0
with sync_playwright() as p:     browser = p.chromium.launch(headless=False, slow_mo=50)     page = browser.new_page()     page.goto('https://ctrl.unruly.co/auth/login')     page.fill('input[id="email"]', username)     page.fill('input[id="password"]',password)     result = solveRecaptcha(         sitekey=sitekey,         url=url     )     code = result['code']     page.evaluate(f"""() => {{         var token = '{code}';         var callbackFunction = ___grecaptcha_cfg.clients['0']['F']['F']['callback'];         callbackFunction(token);     }}""")     page.wait_for_selector("button#submit:not([disabled]):not([tabindex])",state='attached')     page.screenshot(path="debug_screenshot.png")     page.click('button#submit:not([disabled]):not([tabindex])')     page.screenshot(path="debug_screenshot2.png")

This is my script using playwrigth-python, the website has a recaptcha callback. I bypass all of those flawlessly, the 'Sign In' button appear but it is unclickable. Actually it is clickable because when I run the script with 'headless=false', I saw that it is performing the 'page.click' but it did not go to the homepage. Usually if we press the sign in button it will immediately go to the homepage of the website.

The element before the sign in button appear are shown like this:

<button _ngcontent-ng-c3870558994="" nz-button="" nzsize="large" nztype="primary" nzblock="" id="submit" class="ant-btn primary-button ng-tns-c630436078-2 ant-btn-primary ant-btn-lg ant-btn-block" tabindex="-1" disabled="true"><!----><span class="ng-star-inserted"> Sign In </span></button>

And the element after the sign in button appear are shown like this:<button _ngcontent-ng-c3870558994="" nz-button="" nzsize="large" nztype="primary" nzblock="" id="submit" class="ant-btn primary-button ng-tns-c630436078-2 ant-btn-primary ant-btn-lg ant-btn-block"><!----><span class="ng-star-inserted"> Sign In </span></button>

As you can see the two attributes in the HTML will be deleted once the sign in button appear, the 2 attributes tabindex="-1" disabled="true".

I feel like Ive done correctly, but I need some one pov on this. Your help will be mush appreciated. I will provide the snapshots.

this image show that the sign in button appear (dark blue colour)This image show that the page.click in action (slightly pale dark blue) but I feel like it is not clicking

Once you click it will go to the homepage but this is not doing that.

I tried to put page.goto(to the homepage) under the page.click but it kick me back to the login page


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>