python - 在谷歌财经中搜索股票代码

标签 python web-crawler

我正在尝试通过 Google 财经验证股票行情。例如:当我输入“IBEX”时,我期望谷歌金融返回第二个选择而不是第一个。我怎样才能存档这个?

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

Searching stock ticker in google finance

Default result, not expected

Expected Result

最佳答案

正确的股票代码是 LON:IBEX,您需要将其 urlencodeLON%3AIBEX

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

关于python - 在谷歌财经中搜索股票代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44511080/

相关文章:

python - 将 Python 中的字节从 Numpy 数组复制到字符串或字节数组中

python - 退出 python 时为 "StackHash_0a9e error"

python - 在 python 中替换\\为\

python - 简单的sqlite问题

ajax - 在非 JS 可访问站点上使用 !# Ajax 爬虫会在搜索引擎上产生重复内容吗?

concurrency - 如何使用专用 channel 在 go 中发出抓取作业结束的信号

search - 如何阻止搜索引擎查询站点的私有(private)目录?

python - 在 Ctrl-C 上删除 Python 中的回溯

python - Scrapy LinkExtractor - 限制每个 URL 抓取的页面数量

python - 用 Python 爬虫?