asoul / tsec Goto Github PK
View Code? Open in Web Editor NEW台灣上市上櫃股票爬蟲 Taiwan Stock Exchange Crawler
台灣上市上櫃股票爬蟲 Taiwan Stock Exchange Crawler
Hello Asoul~
post_process.py 是不是考慮清除無效的資料
例如代號 2527 2016/5/31 的資料為 105/05/31,0,0,--,--,--,--,,0
您在參考看看
當data有中文的時候(除息),就會出現這個樣子的error。
請問有沒有什麼encode方面的解決辦法呢?
而且我比較好奇的是為什麼會在price difference這個位置放“除息”的資料
然後我看到你在data這個folder裡面 3444.csv裡面直接是沒有了當天的資料,是不是你的try catch的部分有解決到這個問題呢?
UnicodeEncodeError: 'charmap' codec can't encode characters in position 52-53: character maps to <undefined>
證交所並沒有 107/01/13 的交易資料,查過各看盤軟體也都沒有這天的交易資料,這裡的資料庫卻有這天的交易資料。
import requests
url = "http://www.twse.com.tw/exchangeReport/MI_INDEX?response=json&date=20170523&type=24&_=1495583462499"
response = requests.get(url)
改版後,從post變成get提出request,但需要回傳cookie
由於回傳值是json格式,經過分析,回傳內容中股價資料存在 json格式 中的 "data1":[["1437","勤益控","104,976"…]]
import json
data = json.loads(response.text)
print data.keys()
print data["data1"]
s = data["data1"]
type(s)
for item in s:
print item
for i in range(len(s)):
for j in range(len(s[1]):
print s[i][j]
I run the program crawl.py in Mac OS using Python3. Then I got the invalid syntax message as the followings:
$ python3 crawl.py
" File "crawl.py", line 110
print 'Crawling {}'.format(date_str)
^
SyntaxError: invalid syntax"
Also the same results on using python2
是每天跑一次
python crawl.py
嗎?
請問有辦法只爬單檔股票嗎?
Hi Asoul,
Could I use tsec to get EPS of compnay (e.g. TSMC)?
Thanks in advance!
snowuyl
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.