Created
August 10, 2020 21:36
-
-
Save guysoft/974571512a5e9be7f249e39373a4f5ab to your computer and use it in GitHub Desktop.
Scrape all electronics recycle places in Israel
This file contains 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
#!/usr/bin/env python3 | |
import json | |
from urllib.request import urlopen | |
link = "https://mai.org.il/weee_map_israel/" | |
f = urlopen(link) | |
data = f.read().decode() | |
# If you want to try a cache, uncomment this | |
# with open("page.html") as f: | |
# data = f.read() | |
data_1 = data.split('var map1 = $("#map1").maps(')[1] | |
data_2 = data_1.split(').data("wpg')[0] | |
json_data = json.loads(data_2) | |
print(json.dumps(json_data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment