Created
March 3, 2017 01:40
-
-
Save EncodeTheCode/31fb2ea07ff8b90c3f611fc0a1bad665 to your computer and use it in GitHub Desktop.
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
# HLTV stats fetcher in UTF-8 encoding 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() | |
page=data.decode('utf-8') | |
with open('content.txt','w') as f:f.write(page);f.close() | |
if f.closed==1:print("Stream closed.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment