简体   繁体   中英

Javascript/Python - Trouble Clicking Button

I'm using Python's module Spynner for creating a Social Network application, one of the features is being able to create a Tumblr account directly in the application without loading a web browser. Using the ability to run javascript code in the browser, I'm attempting to click a dynamic button, except any idea I use doesn't seem to click it at all. The button's code looks like this, nice and simple.

<button id="signup_forms_submit">
        <span class="account_btn">Démarrer</span>
        <span class="birthday_btn">Suivant</span>
        <span class="captcha_btn"><span>Terminé !</span></span>
        <span class="login_btn">Connexion</span>
</button>

I've tried the following with no results, the button just won't click.

browser.runjs("""$(document.elementFromPoint(393, 373)).click();  """)
browser.runjs("""$('.account_btn').click();""")
browser.click("input[id=signup_forms_submit]", wait_load=True,  timeout=30)

I'm honestly stuck. Any help is apprecieated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM