Skip to content

功能1 输入链接报错 #13

@BZBY

Description

@BZBY

请输入公众号下任意一篇已发布的文章链接:https://mp.weixin.qq.com/s/68fV_36fS_bDM7fTzymm2Q
正常获取到文章内容,开始保存操作
Traceback (most recent call last):
File "E:\Access_wechat_article-v1.0.3\Access_articles.py", line 126, in get_one_article
self.save_one_article(res.text, img_save_flag, content_save_flag) # 开始保存单篇文章
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Access_wechat_article-v1.0.3\Access_articles.py", line 51, in save_one_article
article_title = re.search(r"var title = '(.*?)'. *", article_content).group(1) # 文章标题
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:\Access_wechat_article-v1.0.3\main.py", line 21, in
app.get_article_link(random_url)
File "E:\Access_wechat_article-v1.0.3\Access_articles.py", line 199, in get_article_link
content = super().get_one_article(url, False, False) # 获取网页文本内容
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Access_wechat_article-v1.0.3\Access_articles.py", line 131, in get_one_article
print('\n 检测到抓取出错,文章名>>>> ' + article_title + '\n'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

请问是我的链接出现问题吗?我是直接复制 公众号文章链接的

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions