Nov-19-2022, 02:09 AM
I was able to fix this with exception handling, not sure why I was getting the Nonetypes in the first place, but I did get past it.
I hope this helps someone else with the same issue.
for review in reviews: try: title = review.find('a[data-hook=review-title]', first=True).text except AttributeError: title = None try: rating = review.find('i[data-hook=review-star-rating] span', first=True).text except AttributeError: rating = None try: body = review.find('span[data-hook=review-body] span', first=True).text.replace('\n','').strip() # exchange newlines with a space except AttributeError: body = None data = { # dictionary formatting the data with title hooks for the analyzer to link to "title": title, 'rating': rating, 'body': body } total.append(data) return totalmaking this change got me past it.
I hope this helps someone else with the same issue.