0
我想用XPath来改进我的Xidel输出排除类:通过删除含有“ACLASS”的台词// BODY/DIV,并保持与“MyClass的”的台词只有如何从Xidel输出
我可以添加换行符到Xidel输出文件吗?
<a class="AClass" href="http://www.mywebsite.com/file1" target="_blank"> File1 </a>
<a class="AClass" href="http://www.mywebsite.com/file2" target="_blank"> File2 </a>
<a class="AClass" href="http://www.mywebsite.com/file3" target="_blank"> File3 </a>
<a class="AClass" href="http://www.mywebsite.com/file4" target="_blank"> File4 </a>
<a class="MyClass" href="http://www.mywebsite.com/file5" target="_blank"> File5 </a>
<a class="AClass" href="http://www.mywebsite.com/file6" target="_blank"> File6 </a>
<a class="MyClass" href="http://www.mywebsite.com/file7" target="_blank"> File7 </a>
您正在使用哪种XPath表达式? '// body/div'会返回'div'列表,而不是'a's。通常可以用'[]'或者'except'完成过滤 – BeniBela