I have the following html code from where I extract the text "Classification of protein families" with BS in python.
<h1 class="item-title__primary">
Classification of protein families
However, when I export the data to a excel file, the text comes with a lot of spaces. How can I overcome this issue? Thank you.
Web scraping code:
titles.append(soup.find('h1',class_='item-title__primary').text)