2024-10-01 00:29:19 发布
网友
我希望能够找到包含以下内容的链接:hello,hello,hello,etc.到目前为止,我使用的是对casse敏感的find_elements_by_partial_link_text:
find_elements_by_partial_link_text
links = driver.find_elements_by_partial_link_text('hello')
find_elements_by_partial_link_text()和{}都是区分大小写的,行为不容易改变。
find_elements_by_partial_link_text()
而是查找链接by xpath并应用^{} function:
links = driver.find_elements_by_xpath('//a[contains(lower-case(.), "hello")]')
另请参见:
find_elements_by_partial_link_text()
和{而是查找链接by xpath并应用^{} function :
另请参见:
相关问题 更多 >
编程相关推荐