在googlefinan中搜索股票代码

2024-04-19 18:30:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图通过谷歌金融核实股票行情。例如:当我输入“IBEX”时,我希望googlefinance返回的是第二个选项,而不是第一个选项。我该如何存档?在

ticker = 'IBEX'    
url="https://www.google.com/finance?q={}".format(ticker)

Searching stock ticker in google finance

Default result, not expected

Expected Result


Tags: httpscomformaturlwww选项google金融
2条回答

这个问题最终通过使用硒来解决。Firefox驱动程序和PhantomJS都能很好地工作。有了selenium,我也不必担心Google在短期内可以提交多少请求的限制。在

正确的代码是LON:IBEX,您需要urlencode到{}

相关:How to create a stock quote fetching app in python

相关问题 更多 >