0

A portion of the html code I want to scrap looks like this:

<button aria-label="Play" class="history" data-src="webpage.com" data-type="audio/mp3" title="Play" type="button"></button>

I'm trying to scrap the "data-src" section of the button. Ultimately I want to run through the entire webpage and collect all the "webpage.com." I've narrowed it down to scraping the above piece of code using beautiful soup, but I can't quite figure out how to just get the "webpage.com" part.

  • 2
    Does this answer your question? [Extracting an attribute value with beautifulsoup](https://stackoverflow.com/questions/2612548/extracting-an-attribute-value-with-beautifulsoup) – baduker Nov 17 '22 at 07:39
  • `.get('data-src')` should do – Driftr95 Nov 19 '22 at 11:48

0 Answers0