Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint returns HTTP response code 418 ("I'm a teapot") #15

Closed
weyCC81 opened this issue May 11, 2022 · 5 comments
Closed

Endpoint returns HTTP response code 418 ("I'm a teapot") #15

weyCC81 opened this issue May 11, 2022 · 5 comments

Comments

@weyCC81
Copy link

weyCC81 commented May 11, 2022

Current Output
ValueError: couldn't parse https://money.cnn.com/data/fear-and-greed/

Changes to Website
https://edition.cnn.com/markets/fear-and-greed

@TheSnoozer
Copy link
Contributor

Are you using the latest version?

@weyCC81
Copy link
Author

weyCC81 commented May 11, 2022

I just upgraded from 0.1 to 0.2 but getting the same error, added the following lines to debug here "https://github.com/vterron/fear-and-greed/blob/master/src/fear_and_greed/cnn.py"

r.raise_for_status()  # raises exception when not a 2xx response
if r.status_code != 204:
    return r.json()

HTTPError: 418 Client Error: Unknown Error for url: https://production.dataviz.cnn.io/index/fearandgreed/graphdata

Which is "Error 418 - I'm a teapot was an april ..."

@TheSnoozer
Copy link
Contributor

Thanks indeed noticed this as well, should be fixed via #16

@weyCC81
Copy link
Author

weyCC81 commented May 11, 2022

Thanks for your fast reply!

@vterron vterron changed the title Website changes break scraping Endpoint returning HTTP response code 418 ("I'm a teapot") May 11, 2022
@vterron vterron changed the title Endpoint returning HTTP response code 418 ("I'm a teapot") Endpoint returns HTTP response code 418 ("I'm a teapot") May 11, 2022
@vterron
Copy link
Owner

vterron commented May 11, 2022

Release v0.3 with the fix is now available on PyPI.

Thanks @weyCC81 for the report and @TheSnoozer for contributing the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants