Skip to content

Instantly share code, notes, and snippets.

@ythosa
Last active April 30, 2020 13:46
Show Gist options
  • Save ythosa/7fd8feb782dc959ab69a52cd371ef9b0 to your computer and use it in GitHub Desktop.
Save ythosa/7fd8feb782dc959ab69a52cd371ef9b0 to your computer and use it in GitHub Desktop.
# Ez pz parser
import json
import subprocess
def parsing(site_link):
curl_command = f'curl {site_link} > data.json'
data = subprocess.run(curl_command, shell=True)
if data.returncode != 0:
exit('It was some evil there :( Try again :(')
with open('data.json', 'r', encoding='cp1251') as f:
data = json.load(f)
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment