如何确定分页的xpath? [英] How to determine xpath for pagination?

查看:204
本文介绍了如何确定分页的xpath?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在next按钮(分页)的HTML代码下方,请为分页建议xpath

Given below the HTML code of next button (pagination), kindly suggest xpath for pagination

<li class = "pagination-link next-link">
<a data-aa-region="srp-pagination" data-aa-name="srp-next-page"
<span>next</span>
</a>

推荐答案

wait = WebDriverWait(driver, 10)    
element =wait.until(EC.element_to_be_clickable((By.XPATH, "//*[contains(text(),'Next'")))    
print element.text

注意::请将以下导入内容添加到您的解决方案中

Note : please add below imports to your solution

from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait

这篇关于如何确定分页的xpath?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆