Home > OS >  Why   replace as A in excel while scrape data from website in python , I am trying to solve it w
Why   replace as A in excel while scrape data from website in python , I am trying to solve it w

Time:10-06

I am using python, Here is my code and screenshot enter image description here

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)
  • Related