Hello, I'm a beginner who recently started learning python. Let me ask you a question.
I drew a code to extract only the title of the article from Yahoo News.
bs4.FeatureNotFound: Couldn't find a tree builder with the features you
requested: html_parser.Do you need to install a parser library?
will be displayed as .When I ran it in interactive mode, it looked good...
How can I resolve this?
import requests
from bs4 import BeautifulSoup
result=requests.get('https://news.yahoo.co.jp/list/')
soup = BeautifulSoup(result.text, 'html_parser')
midashi_all=soup.find_all('dl', class_='title')
for midashi in midashi_all:
print(midashi.dt.get_text())
The parser you specified for BeautifulSoup appears to be incorrect. Try html.parser
instead of html_parser
.
import requests
from bs4 import BeautifulSoup
result=requests.get('https://news.yahoo.co.jp/list/')
soup = BeautifulSoup(result.text, 'html.parser')
midashi_all=soup.find_all('dl', class_='title')
for midashi in midashi_all:
print(midashi.dt.get_text())
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
612 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.