Skip to content

Instantly share code, notes, and snippets.

@esemi
Last active May 4, 2026 18:11
Show Gist options
  • Select an option

  • Save esemi/662314d0579cec5110f1c0922642824c to your computer and use it in GitHub Desktop.

Select an option

Save esemi/662314d0579cec5110f1c0922642824c to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
urls = (
'https://www.tehnomedia.rs/telefonija/mobilni-telefon/apple-iphone-17-256gb-mist-blue-mg6l4sx-a.html#data',
'https://www.tehnomedia.rs/it-uredjaji/laptop/asus-zenbook-duo-ux8406ca-pz042x,-14inch-oled-3k-touch-screen,-ultra-9-arl-h,-32gb,-2tb,-win-11-pro.html#data',
'invalid-url', # fixme
)
async def scraper(url: str) -> str:
html = requests.get(url)
return html.text
for url in urls:
# scrapper
raw_html_content = scraper(url)
# parser
soup = BeautifulSoup(raw_html_content)
title_element = soup.find(class_="product-title").find(name='h1').text
price_element = soup.find(class_="price").find(name='strong').text
print(title_element, price_element)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment