Open chingwen823 opened 6 years ago
You can try this:
stocks = [Stock(symbol) for symbol in ['2330', '6515']]
I don't think it's a good idea to allow Stock(['2330', '6515'])
.
Maybe you can elaborate more on your use case?
thanks you are right what I trying to do is to compare a group of stocks with another
I will maintain a local dataset instead
by the way , the time limitation of connections of twes seems to be 3times/5sec
Yeah, it's very easy to be banned by TWSE. I always add a 1~5s random sleep between each request.
我很好奇 一般限制是單位時間裡的連線數 如果不重建connection,連線的sesssion沒斷 應該可以一直無限去下查詢??(就不會被ban是嗎?)
我有想過這個問題,不過沒有測試過 另外 user agent 可能也有影響 不知道有沒有人測試過?
@chingwen823
要如何作到不重建 connection 但是可以換查詢?
我不知道 我後來自已寫了一套
Ming-Hsuan-Tu notifications@github.com 於 2019年3月7日 下午8:48 寫道:
@chingwen823 https://github.com/chingwen823 要如何作到不重建 connection 但是可以換查詢?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mlouielu/twstock/issues/41#issuecomment-470512531, or mute the thread https://github.com/notifications/unsubscribe-auth/APCdodOuldHZqYfXBEZ2g3M_2Ek2T3NOks5vUQqPgaJpZM4Tc3cG.
我不知道 我後來自已寫了一套
Ming-Hsuan-Tu notifications@github.com 於 2019年3月7日 下午8:48 寫道:
@chingwen823 https://github.com/chingwen823 要如何作到不重建 connection 但是可以換查詢?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mlouielu/twstock/issues/41#issuecomment-470512531, or mute the thread https://github.com/notifications/unsubscribe-auth/APCdodOuldHZqYfXBEZ2g3M_2Ek2T3NOks5vUQqPgaJpZM4Tc3cG.
那真的不重建連線就能一直查下去不被封嗎
有沒有一次抓取的方法? ex. restock.Stock(['2330','6515'])
try with list got en error back:
stock = twstock.Stock(stocknum) 2 stock
TypeError Traceback (most recent call last)