cari

Rumah  >  Soal Jawab  >  teks badan

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

伊谢尔伦伊谢尔伦2781 hari yang lalu779

membalas semua(1)saya akan balas

  • PHP中文网

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

    Mungkin data dimuatkan secara tak segerak

    balas
    0
  • Batalbalas