2024-10-04 07:33:36 发布
网友
我正在使用selenium python和莴苣来测试django应用程序。
以下模式中有许多元素具有xpath,我不知道文档中有多少元素。在
.//*[@id='accordion-note-1'] .//*[@id='accordion-note-2'] .//*[@id='accordion-note-3'] .//*[@id='accordion-note-4']
有没有办法在中使用patterndriver.find_元素? 我的xpath基本上是为了得到所有的项目。在
不确定这是否有效,但您可以尝试使用以下xpath:
.//*[starts-with(@id, 'accordion-note')]
这是链接 http://www.zvon.org/xxl/XSLTreference/Output/function_starts-with.html
你也可以在这里使用contain like
不确定这是否有效,但您可以尝试使用以下xpath:
这是链接 http://www.zvon.org/xxl/XSLTreference/Output/function_starts-with.html
你也可以在这里使用contain like
^{pr2}$相关问题 更多 >
编程相关推荐