Python 2.7.16
pip3 install requests
pip3 install beautifulsoup4
test3.py
import requests
from bs4 import BeautifulSoup
r = requests.get("https://news.yahoo.co.jp/")
soup = BeautifulSoup(r.content, "html.parser")
#Nur Text extrahieren
print(soup.find("ul", "newsFeed_list").text)
Recommended Posts