V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
yangjiaronga
V2EX  ›  问与答

scrapy xpath 问题

  •  
  •   yangjiaronga · Feb 7, 2017 · 1828 views
    This topic created in 3372 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   ·   2503 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 02:43 · PVG 10:43 · LAX 19:43 · JFK 22:43
    ♥ Do have faith in what you're doing.