Skip to content
Advertisement

How to scrape

so I am trying to figure out how I can possible scrape a javascript tag using regex which I believe might be the easiest way.

The tag looks like:

JavaScript

and I want to scrape all Label

Whaht I tried to do is:

JavaScript

but it only returned an empty value of []

so I am here asking what can I do to be able to scrape the labels?

Advertisement

Answer

You need to specify the attribute using attr=value or attrs={'attr': 'value'} syntax.

https://www.crummy.com/software/BeautifulSoup/bs4/doc/#the-keyword-arguments

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement