requests-html 模块没有响应

requests-html module does not respond

我是新 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

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

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

阅读更多here