I\'d like to understand how to extract a h1 tag text which contains many others tags in it using beautiful soup :
For the current link that you have provided you can get it like this:
company = soup.select('h1.listing-name')[0].text.strip()
print(company)
Output:
Astra Hôtel Vevey 4*sup
Try using a dictionary:
company = soup.find('h1', {'class' : 'listing-name'})
Or the following:
company = soup.find('h1', class_ ='listing-name')
Note the underscore after class. This is because class is a reserved word in python.
More info can be found here: https://www.crummy.com/software/BeautifulSoup/bs4/doc/#attrs