简体   繁体   English

Selenium Python-无法单击元素

[英]Selenium Python - Can't click on element

I'm trying to selenium click on the "next" button at the bottom of the page (just as shown by cursor in image) 我正在尝试硒单击页面底部的“下一步”按钮(正如图中的光标所示) 在此处输入图片说明

Here's the link to full web: http://hr.jsbchina.cn/zp/trs/hotPostList.do 这是到完整网络的链接: http : //hr.jsbchina.cn/zp/trs/hotPostList.do

I've tried three methods: 我尝试了三种方法:

1) The conventional click 1)常规点击

nextbutton = browser.find_element_by_xpath('/html/body/form/table[5]/tbody/tr/td[2]/a')
nextbutton.click()
browser.implicitly_wait(10)

2) The "element_to_be_clickable" 2)“ element_to_be_clickable”

wait = WebDriverWait(browser, 10)
wait.until(EC.element_to_be_clickable((By.XPATH, '/html/body/form/table[5]/tbody/tr/td[2]/a'))).click() 
time.sleep(10)

3) I've also tried adding the page number to the page "text field" and clicking on "Go". 3)我也尝试过将页码添加到页面“文本字段”,然后单击“转到”。 And I've tried resizing window size as follows: 而且我尝试按如下方式调整窗口大小:

browser.set_window_size(1920, 1080)
browser.implicitly_wait(10)

Are there any other methods to click on "next"? 还有其他方法可以点击“下一步”吗? Because the rest can't seem to work. 因为其余的似乎无法正常工作。

Below locators should help you. 以下定位器应为您提供帮助。

driver.find_element_by_link_text('next')

OR 要么

driver.find_element_by_partial_link_text('next')

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

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