Hello everybody,
could you please help me figuring out, why the following feedparser code works locally (I get the feed with 20 entries) but fails when the same script is executed on pythonanywhere (full error message below)?
feed = feedparser.parse(f"https://www.feed_url.rss", agent='XYZ/3.0')
I have purchased a Hacker subscription, tried different agents, and updated feedparser. On my local machine, I'm using a miniconda environment and on pythonanywhere I'm just using the preinstalled python packages. The versions are different. Might that be the reason?
Any idea on how to fix this issue?
Thank you very much in advance! Best regards Key
Here is what I get when printing the feed object:
{'bozo': 1, 'entries': [], 'feed': {'summary': '<h1>Access Denied</h1>\n \nYou don\'t have permission to access "http://www.feed_url.rss" on this server.<p>\nReference #18.8f2a0660.1656365549.9fe5689'}, 'headers': {'mime-version': '1.0', 'content-type': 'text/html', 'content-length': '313', 'cache-control': 'max-age=0', 'date': 'Mon, 27 Jun 2022 21:32:29 GMT', 'connection': 'close', 'server-timing': 'edge; dur=1'}, 'href': 'https://www.feed_url.rss', 'status': 403, 'encoding': 'us-ascii', 'bozo_exception': SAXParseException('mismatched tag'), 'version': '', 'namespaces': {}}