【问题标题】:Why does package yahoo_earnings_calendar stop working?为什么包 yahoo_earnings_calendar 停止工作?
【发布时间】:2021-08-02 14:20:57
【问题描述】:

我正在使用包 yahoo_earnings_calendar 从雅虎获取收入日历,一个月前它运行良好。

from yahoo_earnings_calendar import YahooEarningsCalendar
yec = YahooEarningsCalendar()
yec.get_earnings_of('box')

但今天我发现它会引发错误。我打印了错误,它向我发送了这条 html 消息。

Yahoohtml{height:100%}body{background:#fafafc url(https://s.yimg.com/nn/img/sad-panda-201402200631.png) 50% 50%;background-size:cover;height: 100%;text-align:center;font:300 18px "helvetica neue",helvetica,verdana,tahoma,arial,sans-serif}table{height:100%;width:100%;table-layout:fixed;border-折叠:折叠;边框间距:0;边框:0}h1{font-size:42px;font-weight:400;color:#400090}p{color:#1a1a1a}#message-1{font-weight:bold ;margin:0}#message-2{display:inline-block;*display:inline;zoom:1;max-width:17em;_width:17em}document.write('&test="+encodeURIComponent("%") +'" width="0px" height="0px"/>');var beacon=new Image();beacon.src="//bcn.fp.yahoo.com/p?s=1197757129&t="+new Date().getTime()+"&src=aws&err_url="+encodeURIComponent(document.URL)+"&err=%&test="+encodeURIComponent("%");马上回来...谢谢您的耐心。我们的工程师正在迅速解决问题。

我发现了其他类似的问题。雅虎似乎不希望我们抓取他们的数据。但是那些帖子并没有解决我的代码块。有人可以帮助我吗?非常感谢!

【问题讨论】:

    标签: python yahoo-api yfinance


    【解决方案1】:

    我遇到了类似的问题。这是我今天回答的问题的链接。雅虎重做了他们的网站,所以现在您必须升级软件包以进行更改。

    Error when creating graph with mplfinance

    【讨论】:

    • 您好,我试过了,还是不行。我使用的是包 yahoo_earnings_calendar 而不是 yfinance。但我认为这两个问题都源于雅虎的网络抓取政策。
    • @ZhibaiLuo 当你说你试过的时候,你包括 pip uninstall yahoo-earnings-calendarpip install --upgrade --no-cache-dir yahoo-earnings-calendar ??
    猜你喜欢
    • 1970-01-01
    • 2011-11-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-30
    • 2018-01-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多