相关疑难解决方法(0)

xpath返回所有非空文本节点,而不是`a`,`style`或`script`的后代

什么表达式将选择所有文本节点:

  • 不是空白
  • 不在里面a,script或者style

xpath

16
推荐指数
2
解决办法
6195
查看次数

在 Scrapy 中连接 Xpath 嵌套文本

我一直在尝试将一些嵌套文本与 Scrapy 中的 xpath 连接在一起。我认为它使用 xpath 1.0?我看了一堆其他帖子,但似乎没有什么是我想要的

这是 html 的特定部分(实际页面http://adventuretime.wikia.com/wiki/List_of_episodes):

<tr>
<td colspan="5" style="border-bottom: #BCD9E3 3px solid">
    Finn and Princess Bubblegum must protect the <a href="/wiki/Candy_Kingdom" title="Candy Kingdom">Candy Kingdom</a> from a horde of candy zombies they accidentally created.
</td>
</tr>

<tr>
<td colspan="5" style="border-bottom: #BCD9E3 3px solid">
Finn must travel to <a href="/wiki/Lumpy_Space" title="Lumpy Space">Lumpy Space</a> to find a cure that will save Jake, who was accidentally bitten by <a href="/wiki/Lumpy_Space_Princess" title="Lumpy Space Princess">Lumpy Space Princess</a> at Princess …
Run Code Online (Sandbox Code Playgroud)

html python xpath scrapy web-scraping

3
推荐指数
1
解决办法
2016
查看次数

标签 统计

xpath ×2

html ×1

python ×1

scrapy ×1

web-scraping ×1