Skip to content Skip to sidebar Skip to footer

Beautifulsoup Not Extracting Div Properly

BeautifulSoup is not extracting the div I want properly. I am not sure what I am doing wrong. Here is the html:

Solution 1:

I see no problem using select

from bs4 import BeautifulSoup as bs
html = '''
<div id='display'>
                      <div class='result'>
                           <div>text0 </p></div>
                           <div>text1</div>
                           <div>text2</div>
                       </div>
                  </div>
                  '''
soup = bs(html)
soup.select('.result')

Post a Comment for "Beautifulsoup Not Extracting Div Properly"