Menu

Build a Web Scraper in 10 Minutes with Python
📰
0

Build a Web Scraper in 10 Minutes with Python

DEV Community·qing·about 1 month ago
#GgSzKDY9
Reading 0:00
15s threshold

qing

Web scraping is valuable. Here's a quick tutorial.

import httpx
from bs4 import BeautifulSoup
r = httpx.get('https://news.ycombinator.com')
soup = BeautifulSoup(r.text, 'html.parser')
for item in soup.select('.titleline a'):
    print(item.text)

Enter fullscreen mode Exit fullscreen mode


More tutorials at https://青.失落.世界

Read More