try:
response = requests.get(file_name, timeout=20)
except:
print(f"err. conn: {file_name}")
continue
try
, и исправить её или правильно её обрабатывать. def get_content(source):
soup = BeautifulSoup(source.text, "html.parser")
Stock = soup.find_all('a', {"href": '/invest/stocks/MMM/'})
Info = []
item = Stock[0]
name = item.find('span', {"class": "NameColumn__nameWrapper_177eF"}).get_text()
Info.append({'Name': name})
item = Stock[2]
price = item.find(("span", {"class": "Money-module__money_3h4MT"})).get_text().split('\xa0')[0]
Info.append({'Price': price})
print(Info)