Created
October 14, 2025 14:24
-
-
Save esemi/662314d0579cec5110f1c0922642824c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| urls = ( | |
| 'https://www.tehnomedia.rs/telefonija/mobilni-telefon/apple-iphone-17-256gb-mist-blue-mg6l4sx-a.html#data', | |
| 'yet-another-model-url', # fixme | |
| ) | |
| for url in urls: | |
| # scrapper | |
| html = requests.get(url) | |
| raw_html_content = html.text | |
| # 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