Created
July 14, 2018 08:41
-
-
Save mlouielu/78db4fa725990c802055bc0e7307e0a2 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
import requests | |
from lxml import etree | |
r = requests.post('http://mops.twse.com.tw/mops/web/ajax_t93sc01_1', {'encodeURIComponent': 1, 'step': 1, 'firstin': 1, 'off': 1, 'TYPEK': 'sii'}) | |
r.encoding = 'utf-8' | |
root = etree.HTML(r.text) | |
for r in root.xpath('//tr')[2:]: | |
print(list(r.itertext())) | |
Author
mlouielu
commented
Jul 14, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment