Web Scraping: Haber Başlıklarını Çekme

← LİSTEYE DÖN

Açıklama

Belirlenen bir haber sitesinden anlık başlıkları çekip listeleyen temel scraping örneği.
PYTHON SOURCE CODE
import requests
from bs4 import BeautifulSoup

url = "https://news.ycombinator.com/"
page = requests.get(url)
soup = BeautifulSoup(page.content, "html.parser")

for story in soup.find_all("span", class_="titleline")[:10]:
    print(story.text)
Görüntülenme: 30
Ekleyen: Admin