I’ve been using BeautifulSoup to extract multiple pages of reviews from websites, and it’s worked wonders mostly but on large datasets has constantly been getting stuck at seemingly random points.
My code is always along the lines of the following.
for x in range(len(reviews)):
reviewsoups.append(BeautifulSoup(requests.get(reviews[x]).text, ‘html.parser))
I’ve never gotten any errors or anything (except the random ConnectionReset error), but it just seems as though the loop gets stuck randomly to the point where I consistently have to interrupt the kernel (which often takes 10+ minutes to actually work) and restart the process from the index where the loop got stuck.
It seems as though in some cases, if I try and use my laptop whatsoever while the code is running (like opening Chrome etc) that aggravates the situation.
Can anyone help? It’s just incredibly irritating having to sit by my laptop waiting just in case something like this happens.
Thanks in advance.