dimanche 6 mai 2018

Web Scraping using BeautifulSoup [alt] [python]

I am given a HTML code, a part which particularly interests me looks like this:

<a href="/go/wydarzenia/rozrywka/35826-majowka-w-twierdzy-klodzko? 
termin=265036" class="link with-img"> <img 
src="/go/resources/main/img//download/img- 
14ab4e372df7bd0826c90f429f0e5933/twierdza-przewodnik-jpg.jpg" alt="Majówka w 
Twierdzy Kłodzko" class=""/>

I know that it looks a bit messy but I have to deal with it anyhow.
My job is to extract the text after alt.
So in the code above the output should look like this

>> Majówka w Twierdzy Kłodzko

I read here a lot of useful information about extracting data by searching CSS classes or HTML tags. However I didn't find anything anout alt. I would appreciate any help.




Aucun commentaire:

Enregistrer un commentaire