2017-01-09 83 views
0

我的問題是關於網絡使用Python 3.刮我發現了一個腳本來自動導入從雅虎財經,其地址是一個CSV文件:現在,我要進口一些變化的價值http://ichart.finance.yahoo.com/table.csv?s=AAPL網絡與Python刮3

(股價,成交量,買價,賣價),但我不知道該怎麼做,因爲當我使用我以前的腳本時,它將html頁面的所有代碼導入到一個csv文件中,而我只是想導入一些值而不是代碼。該頁面的地址是:http://finance.yahoo.com/quote/AAPL?ltr=1

任何人都看過這樣的腳本?

+1

有美麗湯庫:https://www.crummy.com/software/BeautifulSoup/ –

回答

2

如果您對Yahoo Finance提供的財務數據感興趣,可以使用yahoo finance python library

這是open source它有模塊,可以幫助您評估和分析歷史數據。

如果您有關於雅虎財經圖書館的使用有任何疑問,您可以使用yahoo-finance tag

這裏打開一個計算器的問題是所有可用的方法列表:

get_price() 
get_change() 
get_percent_change() 
get_volume() 
get_prev_close() 
get_open() 
get_avg_daily_volume() 
get_stock_exchange() 
get_market_cap() 
get_book_value() 
get_ebitda() 
get_dividend_share() 
get_dividend_yield() 
get_earnings_share() 
get_days_high() 
get_days_low() 
get_year_high() 
get_year_low() 
get_50day_moving_avg() 
get_200day_moving_avg() 
get_price_earnings_ratio() 
get_price_earnings_growth_ratio() 
get_price_sales() 
get_price_book() 
get_short_ratio() 
get_trade_datetime() 
get_historical(start_date, end_date) 
get_info() 
get_name() 
refresh() 
get_percent_change_from_year_high() 
get_percent_change_from_year_low() 
get_change_from_year_low() 
get_change_from_year_high() 
get_percent_change_from_200_day_moving_average() 
get_change_from_200_day_moving_average() 
get_percent_change_from_50_day_moving_average() 
get_change_from_50_day_moving_average() 
get_EPS_estimate_next_quarter() 
get_EPS_estimate_next_year() 
get_ex_dividend_date() 
get_EPS_estimate_current_year() 
get_price_EPS_estimate_next_year() 
get_price_EPS_estimate_current_year() 
get_one_yr_target_price() 
get_change_percent_change() 
get_dividend_pay_date() 
get_currency() 
get_last_trade_with_time() 
get_days_range() 
get_year_range() 
+0

爲什麼這個答案downvoted? – Tagc

+0

我也不知道......如果downvoter解釋了原因,那會更有意義。 –

+0

謝謝dot.Py.我嘗試通過運行以下行來下載yahoo-finance模塊:「pip install yahoo-finance」,但出現錯誤消息:「無效語法」。你有一個想法是什麼不工作? –