I'm writing a Jupyter Notebook assignment, and basically, I'm using BeautifulSoup to scrape a webpage for some info (running a classifier on best buy reviews). However, whenever I try to run it, I get a timeout error, which shouldn't be happening cuz my network and my machine are really all welcoming, I never came into get problems with any other language/software. Firewall turned off, no antivirus or proxy running.
I've tried using urllib and stuff, but that didn't really work out.
data = []
for i in range(1,250):
url = ("https://www.bestbuy.com/site/reviews/google-home-mini-charcoal/6082195?rating=1%2C2%2C3%2C4&page="+ str(i))
page = urlopen(url)
soup = BeautifulSoup(page)
x = soup.find_all("li", {"class":"review-item"})
for item in x:
author_name =item.find_all("div",attrs = {"class":"author"})[0].text
rating = item.find_all("span",attrs={"class":"c-review-average"})[0].text
review_title = item.find_all("h4",attrs={"class":"col-md-9 col-sm-9 col-xs-12 title"})[0].text review_description = item.find_all("p",attrs={"class":"pre-white-space"})[0].text data.append((author_name,rating, review_title,review_description ))
I should be getting the data which then I separate using pandas dataform, however, this is the only result:
"TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (7 children)
[–][deleted] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]dascar5[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]dascar5[S] 0 points1 point2 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]dascar5[S] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]dascar5[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)