Skip to content

Instantly share code, notes, and snippets.

@EncodeTheCode
Created March 3, 2017 01:39
Show Gist options
  • Save EncodeTheCode/0948165ab42be5a1fc2e63640a00bfe5 to your computer and use it in GitHub Desktop.
Save EncodeTheCode/0948165ab42be5a1fc2e63640a00bfe5 to your computer and use it in GitHub Desktop.
# HLTV stats fetcher in bytes written by ETC (EncodeTheCode)
import urllib.request as u
user_agent='Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0.2 Waterfox/49.0.2'
headers={'User-Agent':user_agent}
req=u.Request('http://www.hltv.org/ranking/teams/',None,headers)
response=u.urlopen(req)
data=response.read()
response.close()
with open('content.txt','wb') as f:f.write(data);f.close()
if f.closed==1:print("Stream is closed.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment