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

爬虫报错

  •  
  •   pythlo · Mar 23, 2020 · 1525 views
    This topic created in 2239 days ago, the information mentioned may be changed or developed.

    这几行代码哪里错了

    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
       Mar 23, 2020
    已解决问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1654 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 16:21 · PVG 00:21 · LAX 09:21 · JFK 12:21
    ♥ Do have faith in what you're doing.