Created
November 20, 2016 23:28
-
-
Save tvorogme/eafbd6d459eda0838d3f87942eba1a76 to your computer and use it in GitHub Desktop.
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
from urllib.request import urlopen | |
from concurrent import futures | |
import pickle | |
site = "http://www.nnov.kp.ru/daily/1/" | |
last_publication = 3625745 | |
start = 3527000 | |
answer = [] | |
def get_page(n): | |
api_html = urlopen(site+str(n)).read().decode() | |
answer.append(api_html) | |
print('\r', len(answer), end="") | |
with futures.ThreadPoolExecutor(50) as executor: | |
executor.map(get_page, range(start, last_publication)) | |
pickle.dump(answer, open('users.pck','wb')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment