2017-01-09 77 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”,但出现错误消息:“无效语法”。你有一个想法是什么不工作? –