我想用超文本选择母子或母子:TreeBuilder:XPath Perl模块, 让我们抽取如下的超文本:
<tbody>
<tr>
<td class="c1">Match_Text</td>
<td class="c2">Extact_Text</td>
</tr>
<tr>
<td class="c1"></td>
<td class="c2"></td>
</tr>
</tbody>
因此,我要为我作如下文 to:
/html/body//td[@class="c1"]="Match_Text"/../td[@class="c2"]
which is a valid expression for my use case.
但是,我想到的是母子没有执行,我从垂直模块中看到错误:
axis axis_parent not implemented [Can t locate object method "getParentNode" via package "XML::XPathEngine::Literal" at /usr/local/share/perl/5.10.1/XML/XPathEngine/Step.pm line 326. ]
任何人都可以提出一种可供本人使用的替代Xpath表述(接触母子/ no子)。 请注意,我只想用Xpath的表述来这样做,并有意制造一种多功能,并明确tra树。