Skip to content

Instantly share code, notes, and snippets.

@mlouielu
Created December 19, 2018 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlouielu/2900ef3d1ed0ea95b08e2bfec6a14660 to your computer and use it in GitHub Desktop.
Save mlouielu/2900ef3d1ed0ea95b08e2bfec6a14660 to your computer and use it in GitHub Desktop.
import requests
URL = 'http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&date=20181218&type=ALL'
def main(url):
r = requests.get(url)
with open('test.csv', 'w') as f:
f.write(r.text)
if __name__ == '__main__':
main(URL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment