찾다

 >  Q&A  >  본문

python - scrapy xpath 问题

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>消失不见,为什么呢?

伊谢尔伦伊谢尔伦2777일 전777

모든 응답(1)나는 대답할 것이다

  • PHP中文网

    PHP中文网2017-04-18 10:19:32

    비동기적으로 데이터가 로드될 수 있음

    회신하다
    0
  • 취소회신하다