【问题标题】:requests-html module does not respondrequests-html 模块没有响应
【发布时间】:2021-02-22 11:47:28
【问题描述】:

我是一个新的 Python 用户,我正在尝试使用 requests-html 模块进行网络抓取。我正在使用 Jupyter 开发 Mac。当我输入时

pip install requests-html

看起来我可以安装模块,因为我收到以下消息:

Requirement already satisfied: requests-html in /Users/usr/opt/anaconda3/lib/python3.8/site-packages (0.10.0)

然后我输入

from requests-html import HTMLSession

并得到以下错误:

  File "<ipython-input-6-af86b1357aeb>", line 1
    from requests-html import HTMLSession
                 ^
SyntaxError: invalid syntax

对于解决此问题的任何帮助,我将不胜感激。

【问题讨论】:

    标签: python web-scraping python-requests-html


    【解决方案1】:

    这是from requests_html import HTMLSession 而不是from requests-html import HTMLSession

    阅读更多here

    【讨论】:

      猜你喜欢
      • 2017-03-30
      • 1970-01-01
      • 1970-01-01
      • 2022-11-03
      • 2022-12-21
      • 2015-04-11
      • 2014-03-18
      • 2018-08-01
      • 2016-06-15
      相关资源
      最近更新 更多