0
我试图在XPath中使用OR运算符,它适用于Chrome Inspect。但它使它无法在PHP上工作。没有OR运算符的初始XPath在PHP中工作得很好。XPath在Chrome Inspect中运行,但不在PHP中
这是初始的XPath:
//h4[text()="Description"]/following-sibling::*[not(@class)][not(@style)]
这是改性的XPath
//h4[text()="Description"]/following-sibling::*[not(@class)|@class="MsoNormal"][not(@style)]
我用了这个链接
http://websiteproperties.com/websites/13425-trademarked-brand-mens-personal-care-product-amazon-fba/
改性的XPath后,我从PHP脚本中得到这个错误:
Warning: DOMXPath::query(): Invalid type in D:\xampp\htdocs\PHP projects\Centurica\centurica\lib\custom\class_ff_parser.php on line 660
Warning: DOMXPath::query(): Invalid expression in D:\xampp\htdocs\PHP projects\Centurica\centurica\lib\custom\class_ff_parser.php on line 660
请提供一个可用于重现问题的XML和您的代码的小例子。 – ThW