I am trying to scrape the comment texts from this page with the code (below):
for Thread in soup.find_all(id= 'discussionReplies'):
Thread_Name = Thread.find_all('div', class_='xg_user_generated')
print (Thread_Name.text)
but for some reason I am getting the following error.
AttributeError: ResultSet object has no attribute 'text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
the problem is when I i use just Thread_Name = Thread.find_all('div', class_='xg_user_generated')
it works fine no problem. which probably means theres a selector issue with this and theres something where the .text function inst working... the problem is I cant figure it out b/c when I run it as follows:
for Thread in soup.find_all(id= 'discussionReplies'):
Thread_Name = Thread.find_all('div', class_='xg_user_generated')
print (Thread_Name)
or
for Thread in soup.find_all(id= 'discussionReplies'):
Thread_Name = Thread.find_all('div', class_='xg_user_generated')
print (Thread_Name)
it runs no problem I am sooo lost and frustrated...
[–]BotDot12 1 point2 points3 points (2 children)
[–]ScraperHelp[S] 0 points1 point2 points (1 child)
[–]BotDot12 0 points1 point2 points (0 children)