英文:
I can't push button with Selenium
问题
website: (https://www.tiktok.com/signup/phone-or-email/email)
我想点击"发送验证码"按钮,但没有任何反应。
driver2.find_element(By.XPATH, '//button[@class="tiktok-1fcfbw8-ButtonSendCode e1gzcpl10"]')
我已尝试使用XPATH和CLASS_NAME查找,尝试使用ActionChains进行点击。
但没有起作用。
英文:
website: (https://www.tiktok.com/signup/phone-or-email/email)
I want to push button "Send code", but nothing happen.
driver2.find_element(By.XPATH, '//button[@class="tiktok-[enter image description here]
(https://i.stack.imgur.com/i7LGv.png)1fcfbw8-ButtonSendCode e1gzcpl10"]')
I had tried find by XPATH, CLASS_NAME; tried do click by ActionChains.
But it's not work
答案1
得分: 0
以下是翻译好的部分:
"按钮的类是动态的,并且每次运行都会更改,这就是为什么它不起作用,所以你必须使用
#//button[text()="Send code"]
driver2.find_element(By.XPATH, '//button[text()="Send code"]')
此外,只有在填写所有字段之后才会启用它,所以在点击之前你应该这样做"
英文:
The class for button is dynamic and changes for every run that why its not working ,so you have to use
#//button[text()="Send code"]
driver2.find_element(By.XPATH, '//button[text()="Send code"]')
Also it will only enable after all fields are filled so you should do that before clicking on it
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论