1

I am browsing through HTML scripts with BeautifulSoup4 and I am trying to find an exact match of a tag. I tried this:

textTag = soup.find_all('div', {"class": re.compile(r'^storycontent$')})

The result I wanna get is ONLY: <div class="storycontent">, but it also returns <div class="storycontent ytstory">

So, I am looking for a way to find an exact match (attribute class only contains storycontent and no other word or character).

Does anyone have any ideas? :-)

0 Answers0