https://co.bsnws.net/article/287
こちらのサイトを参考にrequests-htmlを追加しようとしましたが
C:\Users\sasak\python_edit>script.py
Traceback (most recent call last):
File "C:\Users\sasak\python_edit\script.py", line 1, in <module>
from requests_html import session # requests_htmlの読み込み
ModuleNotFoundError: No module named 'requests_html'
とモジュールがないと言われます。
同じディレクト内で pip install requests-html
と呼び出しても既にあると言われます
どうすれば実行できるようになるでしょうか?
お優しい方助けてください。。。
Requirement already satisfied: requests-html in d:\lib\site-packages (0.10.0)
Requirement already satisfied: w3lib in d:\lib\site-packages (from requests-html) (1.22.0)
Requirement already satisfied: bs4 in d:\lib\site-packages (from requests-html) (0.0.1)
Requirement already satisfied: pyquery in d:\lib\site-packages (from requests-html) (1.4.3)
Requirement already satisfied: requests in d:\lib\site-packages (from requests-html) (2.25.1)
Requirement already satisfied: fake-useragent in d:\lib\site-packages (from requests-html) (0.1.11)
Requirement already satisfied: pyppeteer>=0.0.14 in d:\lib\site-packages (from requests-html) (0.2.5)
Requirement already satisfied: parse in d:\lib\site-packages (from requests-html) (1.19.0)
Requirement already satisfied: appdirs<2.0.0,>=1.4.3 in d:\lib\site-packages (from pyppeteer>=0.0.14->requests-html) (1.4.4)
Requirement already satisfied: pyee<9.0.0,>=8.1.0 in d:\lib\site-packages (from pyppeteer>=0.0.14->requests-html) (8.1.0)
Requirement already satisfied: tqdm<5.0.0,>=4.42.1 in d:\lib\site-packages (from pyppeteer>=0.0.14->requests-html) (4.59.0)
Requirement already satisfied: websockets<9.0,>=8.1 in d:\lib\site-packages (from pyppeteer>=0.0.14->requests-html) (8.1)
Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in d:\lib\site-packages (from pyppeteer>=0.0.14->requests-html) (1.26.3)
Requirement already satisfied: beautifulsoup4 in d:\lib\site-packages (from bs4->requests-html) (4.9.3)
Requirement already satisfied: soupsieve>1.2 in d:\lib\site-packages (from beautifulsoup4->bs4->requests-html) (2.2)
Requirement already satisfied: cssselect>0.7.9 in d:\lib\site-packages (from pyquery->requests-html) (1.1.0)
Requirement already satisfied: lxml>=2.1 in d:\lib\site-packages (from pyquery->requests-html) (4.6.2)
Requirement already satisfied: chardet<5,>=3.0.2 in d:\lib\site-packages (from requests->requests-html) (4.0.0)
Requirement already satisfied: certifi>=2017.4.17 in d:\lib\site-packages (from requests->requests-html) (2020.12.5)
Requirement already satisfied: idna<3,>=2.5 in d:\lib\site-packages (from requests->requests-html) (2.10)
Requirement already satisfied: six>=1.4.1 in d:\lib\site-packages (from w3lib->requests-html) (1.15.0)
ソースコードはこちらです
python
1 2from requests_html import session # requests_htmlの読み込み 3 4# ターゲットなるURL 5url = 'http://co.bsnws.net/article/269' 6# ページに接続 7response = session.get(url) 8# 取得したオブジェクトをhtmlに変換 9article = response.html 10# ページをtextに変換 11print(article.text) 12# ページをhtmlタグに変換 13# print(article.html)
バージョン
Python 3.8.5
requests-html 0.10.0
回答1件
あなたの回答
tips
プレビュー