Created
August 14, 2024 15:49
-
-
Save Pzdrs/26bb7baccd2c62b95d24c8de74581ad4 to your computer and use it in GitHub Desktop.
Gas prices scraper for ONO gas stations
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 | |
| 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