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