python - scrapy xpath 问题
伊谢尔伦
伊谢尔伦 2017-04-18 10:17:32
0
1
768

Response.body中有

<tr>
    <td style="vertical-align:top;">Copper, Cu</td>
    <td class="dataCell" style="vertical-align:top;"><= 0.03 %<span class="dataCondition"></span></td>
    <td class="dataCell" style="vertical-align:top;"><= 0.03 %<span class="dataCondition"></span></td>
    <td class="dataComment" style="vertical-align:top;"></td>
</tr>

之后运行
**response.xpath('/tr').extract()
只能获取到**

<tr>
    <td style="vertical-align:top;">Copper, Cu&nbsp;</td>
    <td class="dataCell" style="vertical-align:top;"></td>
    <td class="dataCell" style="vertical-align:top;"></td>
    <td class="dataComment" style="vertical-align:top;"></td>
</tr>

的出来的结果
<= 0.03 % 和 <span></span>消失不见,为什么呢?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
Ty80

It may be asynchronously loaded data

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template