次のコードがあります。
from urllib2 import urlopen
from csv import reader
up_url = "http://finviz.com/export.ashx?v=111&f=ind_stocksonly,sh_price_o10,ta_change_u,ta_changeopen_u,ta_highlow20d_nh,ta_highlow50d_nh,ta_highlow52w_nh,ta_sma20_pa,ta_sma200_pa,ta_sma50_pa&ft=4&o=-change"
up_text = urlopen(up_url).readline()
for row in reader(up_text):
print row
したがって、次のようなことを予想しています。
["No.","Ticker","Company","Sector","Industry","Country","MarketCap","P/E","Price","Change","Volume"]
['No.']
['', '']
['Ticker']
['', '']
['Company']
['', '']
['Sector']
['', '']
['Industry']
['', '']
['Country']
['', '']
['Market Cap']
['', '']
['P/E']
['', '']
['Price']
['', '']
['Change']
['', '']
['Volume']
[]
[]
私が理解したように、csv は文字列を '\n' で分割し、次に ',' で分割してリストを作成する必要があります。それで、ここで何が起こっているのですか?