Giter Site home page Giter Site logo

Comments (3)

Alfred1984 avatar Alfred1984 commented on August 18, 2024
  1. UserWarning不是运行错误哈,是python-docx这个安装包对于 document.add_paragraph(article['title'], style='ListNumber') 这段代码的一个提醒性警告,说新版本的python-docx对 style有调整,以后都要用style name 来指定你要使用的style,不能用之前的 style_id 来指定了。我们这里用 style='ListNumber' 正是遵循了它的规定,是没问题的。如果你不想看到这个警告,可以在前面加上:
    import warnings
    warnings.filterwarnings("ignore")
    这样就不会提示了。

  2. 由于目前验证码还不能完全自动识别,所以识别不了的验证码会弹出来人工识别;

  3. 运行到出现UserWarning的时候,应该是程序已经运行完毕了。新生成的文件可以到文件保存路径下查看。

from interesting-python.

ZhengPhilip avatar ZhengPhilip commented on August 18, 2024

问题解决了,谢谢大佬!^_^

from interesting-python.

ZhangHanAA avatar ZhangHanAA commented on August 18, 2024

D:\Anadoda\python.exe D:/pachong/article_collector.py
please input code: azwk
Traceback (most recent call last):
File "D:/pachong/article_collector.py", line 74, in
articles = get_articles(timedel=1)
File "D:/pachong/article_collector.py", line 28, in get_articles
articles.extend(reformat(ws_api.get_gzh_article_by_history(account)))
File "D:\Anadoda\lib\site-packages\wechatsogou\api.py", line 382, in get_gzh_article_by_history
return WechatSogouStructuring.get_gzh_info_and_article_by_history(resp.text)
File "D:\Anadoda\lib\site-packages\wechatsogou\structuring.py", line 375, in get_gzh_info_and_article_by_history
'gzh': WechatSogouStructuring.get_gzh_info_by_history(text),
File "D:\Anadoda\lib\site-packages\wechatsogou\structuring.py", line 240, in get_gzh_info_by_history
profile_img = get_first_of_element(profile_area, 'div[1]/span/img/@src')
File "D:\Anadoda\lib\site-packages\wechatsogou\tools.py", line 56, in get_first_of_element
content = element.xpath(sub)
AttributeError: 'str' object has no attribute 'xpath'

运行公众号爬虫出现这个错误

from interesting-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.