简体   繁体   English

无法单击带有硒 python 的按钮

[英]can't click button with selenium python

i can't find way to press button with selenium.我找不到用硒按下按钮的方法。 tried to click on it by name and xpath, but it didnt worked.试图按名称和 xpath 点击它,但没有奏效。 this is sign in button on this site - https://account.envato.com/sign_in?to=audiojungle这是本网站上的登录按钮 - https://account.envato.com/sign_in?to=audiojungle

this is code of button:这是按钮代码:

<input type="submit" name="commit" value="Sign in to your account" class="js-sign-in__submit e-btn--3d -color-primary -size-m -width-full h-mb2 h-mt1">

if i try to find it by x path, using - driver.find_element_by_xpath('//*[@id="sign-in-form"]/div[6]/input').click() or using - driver.find_element_by_name('commit').click()如果我尝试通过 x 路径找到它,使用 - driver.find_element_by_xpath('//*[@id="sign-in-form"]/div[6]/input').click()或使用 - driver.find_element_by_xpath('//*[@id="sign-in-form"]/div[6]/input').click() driver.find_element_by_name('commit').click()

it comes with this problem -它伴随着这个问题——

raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <input type="submit" name="commit" value="Sign In"formnovalidate="formnovalidate" data-disable-with="Sign In"> is not clickable at point (789, 309). Other element would receive the click: <p style="">...</p>

i don't remember evrything i tried, but i hope you understood me.我不记得我尝试过的所有内容,但我希望你能理解我。 i didn't find solution in internet, so i hope you will help me, thx)我没有在互联网上找到解决方案,所以我希望你能帮助我,谢谢)

Try this: Option 1:试试这个: 选项 1:

wait.until(ec.visibility_of_element_located((By.XPATH,"Your xpath")

Option 2: Check if it is not in iframe.选项 2:检查它是否不在 iframe 中。

Option 3: Use Action or Javascript to click on button.选项 3:使用 Action 或 Javascript 单击按钮。 Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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