I am trying to scrape questions from a
first loop to get the ul with the class question
and then a loop to get the li inside of it
then get the content of the a
is my logic right ??
My issue :
ques=question.find("a", class_="content_permalink").text
TabError: inconsistent use of tabs and spaces in indentation
CodePudding user response:
To fix your issue with the error adjust your indentation:
for content in contents:
ques=question.find("a", class_="content_permalink").text
print(ques)
instead of
for content in contents:
ques=question.find("a", class_="content_permalink").text
print(ques)