Skip to content

Instantly share code, notes, and snippets.

@Pzdrs
Created August 14, 2024 15:49
Show Gist options
  • Select an option

  • Save Pzdrs/26bb7baccd2c62b95d24c8de74581ad4 to your computer and use it in GitHub Desktop.

Select an option

Save Pzdrs/26bb7baccd2c62b95d24c8de74581ad4 to your computer and use it in GitHub Desktop.
Gas prices scraper for ONO gas stations
import requests
import re
import json
content = requests.get('http://m.tank-ono.cz/en/index.php?page=cenik').content.decode('UTF-8') \
.replace('\r', '').replace('\n', '') \
.strip()
result = re.findall(
r'<div class=\"divrow2\"><div class=\"divpr\w{2}\">([A-Z\d+ ]*)</div><div class=\"divprice\">\s*(\d*)\s*<sup>\s*(\d*)\s*</sup>\s*</div><div class=\"divpriceeu\">\s*\d*\s*<sup>\s*\d*\s*</sup></div></div>',
content
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment