yangjiaronga
V2EX  ›  问与答

scrapy xpath 问题

  •  
  •   yangjiaronga · Feb 7, 2017 · 1894 views
    This topic created in 3408 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
        1
    leavic  
       Feb 7, 2017 via iPhone
    确定你看的网页源码是关闭了 javascript 状态下的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5538 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 01:30 · PVG 09:30 · LAX 18:30 · JFK 21:30
    ♥ Do have faith in what you're doing.