Python ile Web Scraping: BeautifulSoup ve Playwright
import requests
from bs4 import BeautifulSoup
resp=requests.get('https://example.com',headers={'User-Agent':'Mozilla/5.0'})
soup=BeautifulSoup(resp.content,'html.parser')
for x in soup.select('.item'):
print(x.text.strip())
Playwright ile SPA Scraping:
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
page=p.chromium.launch().new_page()
page.goto('https://spa.com'); page.wait_for_selector('.data')
print([x.inner_text() for x in page.query_selector_all('.row')])
Kategori:
Proje Geliştirme ve Beyin Fırtınası
Bu konuyu EL11.Net forumunda tartışmak ister misiniz?
Forumda Gör