yangjiaronga
V2EX  ›  问与答

scrapy xpath 问题

  •  
  •   yangjiaronga · Feb 7, 2017 · 2201 views
    This topic created in 3565 days ago, the information mentioned may be changed or developed.
    <tr>
    <td style="vertical-align:top;">Copper, Cu&nbsp;</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>消失不见,为什么呢?
    leavic
    leavic
    Feb 7, 2017 via iPhone
    1
    确定你看的网页源码是关闭了 javascript 状态下的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4545 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:54 · PVG 14:54 · LAX 22:54 · JFK 01:54
    ♥ Do have faith in what you're doing.