I am using python, Here is my code and screenshot
Category = soup.find('a', class_='article-labels__text b-reith-sans-font').text.replace(' ',"").replace('|',"")
print("""\n""") print("Category: ", Category )
CodePudding user response:
Try to use .get_text()
method instead of .text
property
Category = soup.find('a', class_='article-labels__text b-reith-sans-font').get_text(strip=True)