查找“ ul”使用python x_path的元素元素
在尝试建议后,我想在“ follwing” li“ tag”中获得“标题
” M试图使用硒从网页中提取以下“ UL”元素。使用Python,我无法弄清楚X_ Path应该是什么,我尝试了我能想到的一切。还尝试了css_selection。我什么也没回来。
我想迭代该特定“ UL”元素中的“ Li”元素。如果有人能提供帮助,将不胜感激,我实际上尝试了我能想到的/搜索的一切。
The code I want to extract the "ul" element from
After trying suggestion, I want to get "title" in the follwing "li" tag
I'm trying to extract the following "ul" element from a webpage using selenium. Using Python, I can't figure out what the X_PATH should be, I've tried everything I could think of. Also tried the css_selection. I'm getting back nothing.
I want to iterate over the "li" elements within that specific "ul" element. If anybody could help it would be appreciated, I've literally tried everything I can think/search.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对我来说,看起来您可以通过ARIA标签抓住UL,然后从那里选择第一个LI。您还可以检查元素并从开发人员控制台复制XPATH。
它似乎也在iframe中。
进口:
To me it looks like you could just grab the ul by it's aria label and then select the first li from there. You could also just inspect the element and copy the xpath from the developers console.
It also seems to be in an iframe.
Imports:
检查是元素在某些iframe内部,也许是为此,如果不工作,请在浏览器中安装硒扩展程序,并尝试重新汇总流程,您将收到所有XPATH,这是我在没有任何事情对我工作时使用的一种方式。
Check is that element are inside some iFrame, maybe is for that, if that dont work install selenium extension in your browser and try to recreat the flow, you will receive all xpath, is a way that I use when nothing is working to me.