问题描述
当我遇到以下错误时,我试图在我的 jupyter 笔记本中使用库 requests_html:
不能在现有事件循环中使用 HTMLSession。改用 AsyncHTMLSession。
import nest_asyncio
nest_asyncio.apply()
但是当我将其应用于 mi 代码时:
from requests_html import HTMLSession
import nest_asyncio
nest_asyncio.apply()
session = HTMLSession()
r = session.get('http://python-requests.org')
r.html.render()
print(r.html.search('Python 2 will retire in only {months} months!')) # None
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)