Skip to content

Instantly share code, notes, and snippets.

@yfwu
Created April 14, 2018 15:53
Show Gist options
  • Save yfwu/25500fca50b03f99c0871a6ff5593694 to your computer and use it in GitHub Desktop.
Save yfwu/25500fca50b03f99c0871a6ff5593694 to your computer and use it in GitHub Desktop.
內科學誌下載
import requests
import time
prefix = "http://www.tsim.org.tw/journal/jour"
for i in range(19, 30):
for j in range(1, 7):
for k in range(1, 8):
url = prefix + str(i) + "-" + str(j) + "/0" + str(k) + ".PDF"
print(url)
response = requests.get(url)
if response.status_code == "200":
with open(str(i) + str(j) + str(k) + '.pdf', 'wb') as f:
f.write(response.content)
time.sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment