Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用 csquery 来查找具有特定属性和特定值的 html。
所以如果我有一个页面有这样的东西
<html> <body> <div align="left">something</div> </body> </html>
然后我可以通过搜索属性与左值对齐的 div 来获取孔线吗?甚至只是 html 元素,然后从属性中获取值?
一如既往,感谢您的帮助和时间。
我自己没有使用过 csquery,但是在查看文档时,您可以使用 css 查询,这应该可以
div[align='left']
编辑:在确定这是对客户端操作的响应后,在脚本中它应该如下所示:
var rows = query["div[align='left']"];
您可以通过标签和属性选择器查找元素的方法是将您想要的属性放在括号中。然后像这样插入值。