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

爬虫报错

  •  
  •   pythlo · 2020-03-23 16:08:15 +08:00 · 759 次点击
    这是一个创建于 1494 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这几行代码哪里错了

    import requests import re url = 'url' qinqiu = requests.get(url) qinqiu.encoding = qinqiu.apparent_encoding qinqiudy = qinqiu.text nigo = re.compile('<option value="(.*?)" selected="">') goy = re.findall (nigo.qinqiudy) print(goy)

    这是报错 goy = re.findall(nigo.qinqiudy) AttributeError: 're.Pattern' object has no attribute 'qinqiudy'

    pythlo
        1
    pythlo  
    OP
       2020-03-23 17:18:09 +08:00
    已解决问题
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2607 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:08 · PVG 00:08 · LAX 09:08 · JFK 12:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.