【问题标题】:Scraping data from yahoo finance using BeautifulSoup in python在 python 中使用 BeautifulSoup 从 yahoo Finance 中抓取数据
【发布时间】:2017-03-23 15:59:18
【问题描述】:

我正在使用 BeautifulSoup 从 yahoo Finance 抓取过去 5 天的数据。 Here is the link 但我没有得到任何数据。结果给出了除了生成的数据之外的所有内容。 这是我尝试过的:

url = "https://in.finance.yahoo.com/quote/20MICRONS.NS/history?period1=1199125800&period2=1490207400&interval=1d&filter=history&frequency=1d"
request = urllib.request.Request(url,None,headers)
response = urllib.request.urlopen(request).read()
soup = BeautifulSoup(response, 'html.parser')

【问题讨论】:

    标签: python web-scraping beautifulsoup yahoo-finance


    【解决方案1】:

    财务数据不会嵌入到由 JavaScript 加载的网页中。当您向下滚动页面时,您将看到网站加载到页面的新数据。解决此问题的最佳方法是使用seleniumPhantomJS 之类的解决方案。 您可以将它们与python 一起使用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-08
      • 2020-03-12
      • 1970-01-01
      • 2021-12-20
      • 1970-01-01
      • 2014-04-15
      • 1970-01-01
      • 2016-05-28
      相关资源
      最近更新 更多