V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
yangjiaronga
V2EX  ›  问与答

scrapy xpath 问题

  •  
  •   yangjiaronga · 2017-02-07 00:03:58 +08:00 · 1223 次点击
    这是一个创建于 2642 天前的主题,其中的信息可能已经有所发展或是发生改变。
    <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  
       2017-02-07 07:06:36 +08:00 via iPhone
    确定你看的网页源码是关闭了 javascript 状态下的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1098 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:49 · PVG 01:49 · LAX 10:49 · JFK 13:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.