简体   繁体   中英

Python selenium webdriver - textbox and button won't work

I have been playing around with selenium webdriver library for python, I have some programming knowledge but almost none when related to webpages etc.

I am trying to login to this website https://freebitco.in/ I click on the login button, fill the textboxes and then click on the button with selenium but the page just refreshes leaving the inputs blank and nothing happens.

I have tried to manually (ctrl+V) inputing the text and then clicking on the button with selenium, in that case it works. I would love an answer for this fenomenon. I would also like to know how can a webpage differentiate between bot input and user input, from my point of view (no webpage knowledge) I can only see it being able to work with the guest timing etc to tell it's a bot or not, how can it see it is a bot writing in this textboxes? (if it is the case).

Thank you for your answers and forgive my poor english skills. (:

This is my code:

driver.find_element_by_class_name('login_menu_button').click()
driver.find_element_by_id('login_form_btc_address').send_keys(address) 
driver.find_element_by_id('login_form_password').send_keys(password)
driver.find_element_by_id('login_button').click()

this is for the textboxes:

<input type="text" name="btc_address" id="login_form_btc_address">

and this is for the button

<input type="text" name="btc_address" id="login_form_btc_address">

From what I see on that page:

<li class="login_menu_button active">
    <a href="javascript:void(0);">LOGIN</a>
</li>

So even though you are clicking on top menu, I think you are not opening login form Try to change the first click to be on link element:

driver.find_element_by_link_text('LOGIN').click()

Also you will probably need to synchronize between clicks (ie check that what you expected indeed happened)

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