I have Html structure like
<html>
<body>
<-- Some tags -->
<div class="main-sv">
<div class="first-sv custom-sv">
<-- Some tags and content-->
</div>
</div>
</body>
</html>
I want to check out if class value of first child of div
which class value is main-sv
and child tag is div and class value contains First-sv
sub-string.
Following in my code which work fine
>>> "Frist-sv" in dict(soup.find("div", {"class" :"main-sv"}).findChild().attrs)["class"].split(" ")
True
still any other way like xpath
in lxml
?
I have to use beautifulsoup only