I keep getting "An existing connection was forcibly closed by the remote host" when trying to scrape data using beautiful soup. (Python 3.8.5)

Viewed 247

I am trying to scrape data from zacks.com, but before the program can go through I get "ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host." Zacks sells its data for websites and mobile apps through an API, and this error might be caused by zacks.com preventing their data from illegally being sold commercially. However, this is for my own personal use, and nothing in their Terms of Service prohibits this. Is there a way to fix the error?

Here is my code:

from bs4 import BeautifulSoup
import requests

page = requests.get("https://www.zacks.com")
soup = BeautifulSoup(page.content, 'html.parser')

print(soup)
0 Answers
Related