1

I am using package yahoo_earnings_calendar to get earnings calendar from Yahoo and it worked fine one month ago.

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

But today I find it will raise an error. I printed the error and it send me this html message.

    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-collapse:collapse;border-spacing:0;border: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("%");Will be right back...Thank you for your patience.Our engineers are working quickly to resolve the issue.

I find other similar question. It seems that Yahoo do not want us scrape their data. But those posts do not solve my code block. Can somebody help me? Thanks a lot!

Zhibai Luo
  • 21
  • 1

1 Answers1

0

I had a similar problem. Here's the link to my question that was answered today. Yahoo redid their site, so now you have to upgrade the package for the changes.

Error when creating graph with mplfinance

Dharman
  • 30,962
  • 25
  • 85
  • 135
Ashley Adams
  • 95
  • 1
  • 12
  • Hi I tried and it does not work. I am using package yahoo_earnings_calendar not yfinance. But I think both problem result from yahoo's web scrape policy. – Zhibai Luo Aug 03 '21 at 15:30
  • @ZhibaiLuo When you say you tried, *did you include* **`pip uninstall yahoo-earnings-calendar`** and **`pip install --upgrade --no-cache-dir yahoo-earnings-calendar`** ?? – Daniel Goldfarb Aug 04 '21 at 18:09