Skip to content Skip to sidebar Skip to footer

Bs4 Searching By Class_ Returning Empty

I currently am successfully scraping the data I need by chaining bs4 .contents together following a find_all('div'), but that seems inherently fragile. I'd like to go directly to t

Solution 1:

try this

soup.find(attrs={'class':'loan-section-content'})
or
soup.find('div','loan-section-content')

attrs will search on attributes

Demo: Demo

Post a Comment for "Bs4 Searching By Class_ Returning Empty"