我想使用结构搜索来查找例如:
<a data-foo="bar" style="width: 1px;">
<a data-bar="foo">
但是不是:
<a data-foo="bar" style="width: 1px;" href="https://google.com">
<a href="#" data-bar="foo">
是否可以添加脚本过滤器以完成此目标?
答案 0 :(得分:1)
将搜索模板设置为:
A
在<$tag$ $attributeA$=$valueA$ />
上,用$attributeA$
进行过滤。不要过滤text=href, count=[0,0]
。
答案 1 :(得分:-1)
使用:not()
,例如:
document.querySelector('a:not([href])')