pythonでrequest HTMLからスクレイビングをするプログラムを組んでいるのですが
from requests_html import HTMLSession session = HTMLSession() r = session.get('https://www.jpx.co.jp/') r.html.render() tpx = r.html.find('.chart-box', first=True) print(tpx.text)
これを実行したところ
Cannot use HTMLSession within an existing event loop. Use AsyncHTMLSession instead.
というエラーが出たので
from requests_html import AsyncHTMLSession session = AsyncHTMLSession() r = session.get('https://www.jpx.co.jp/') r.html.render() tpx = r.html.find('.chart-box', first=True) print(tpx.text)
と修正したところ
AttributeError: '_asyncio.Future' object has no attribute 'html'
というエラーが出て実行できません。どうしたらいいのでしょうか。

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。