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

实在没找到错在哪里,爬虫方面

  •  
  •   U87 · 2018-04-18 14:47:51 +08:00 · 974 次点击
    这是一个创建于 2202 天前的主题,其中的信息可能已经有所发展或是发生改变。

    import requests from lxml import etree url = 'http://www.gdggzy.org.cn/prip-portal-web/main/Index.do?typeId=200122&city=&businessType=200120' r = requests.get(url=url).text r1 = etree.HTML(r) max_counts = r1.xpath('//div[@id="TestView_queryResult"]//div[@class="m-pagination-info"]/text()') print max_counts

    想取最大数目,取不到,是空的,然后 xoath 里的检查了好几遍感觉没错呀

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5410 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:09 · PVG 16:09 · LAX 01:09 · JFK 04:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.