我可以使用 selenium 还是需要其他模块才能单击这种按钮?请问相关代码是什么?.....请参阅以下详细信息,并提前感谢您的帮助。
我完全是编码的新手。慢慢学习Python。
当前项目正在登录交易网站 - 我的代码在最后一次单击按钮时失败。
与按钮相关的 HTML 包括:v-on:click="submitForm" :disabled="isSubmit"
通过快速搜索,这是我不熟悉的 Vue.js。
PS我的第一个编码问题!
错误信息:
第 21 行,在
login_button.click()
AttributeError: 'list' object has no attribute 'click'
书面代码:
from selenium import webdriver
USERNAME = 'XXXXXX'<br>
PASSWORD = 'YYYYYY'
PATH = 'C:\Program Files (x86)\chromedriver.exe'
driver = webdriver.Chrome(PATH)
driver.get('https://www.nabtrade.com.au/investor/home')<br>
open_login_button = driver.find_element_by_id('btn-login')<br>
open_login_button.click()
user_input = driver.find_element_by_id('usernameField')<br>
user_input.send_keys(USERNAME)
password_input = driver.find_element_by_id('passwordField')<br>
password_input.send_keys(PASSWORD)
*login_button = driver.find_elements_by_class_name('btn btn-primary btn-block')*<br>
*login_button.click()*
注意:最后两行代码是失败的