Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
根据XPath中元素的子元素过滤元素';文本_Xpath_Scrapy - Fatal编程技术网

根据XPath中元素的子元素过滤元素';文本

根据XPath中元素的子元素过滤元素';文本,xpath,scrapy,Xpath,Scrapy,假设我有一个包含以下行的表 ... <tr> <th title="Library of Quintessential Memes">LQM:</th> </tr> <tr> <th title="Library of Boring Books">LBB:</th> </tr> ... 。。。 LQM: LBB: ... 我想选择第一个子文本以“L”开头的所有元素。如何使用XPath选择器

假设我有一个包含以下行的表

...
<tr>
  <th title="Library of Quintessential Memes">LQM:</th>
</tr>
<tr>
  <th title="Library of Boring Books">LBB:</th>
</tr>
...
。。。
LQM:
LBB:
...

我想选择第一个
子文本以“L”开头的所有
元素。如何使用XPath选择器执行此操作?

使用
开头的函数:

//tr[starts-with(th[1],"L")]

是否也可以选择所有具有文本以“L”开头的后代(不一定是直系后代)的
元素?