Home > Net >  How to web scrap the text under <i class>?
How to web scrap the text under <i class>?

Time:02-26

I am trying to get the text " Web Resource " under <i class ="fa fa-globe"> or the " PDF file" under <i >. I use BeautifulSoup and tried .find_all('i', class_ ='fa fa-globe') and it didn't work. Any ideas on how to get the text?

<div >
  ::before
  <span >
    <i >
      ::before
    </i>
    " PDF file"
  </span> 
  ::after
</div>

enter image description here

CodePudding user response:

for x in soup.find('i'):
     soup.find('i').nextSibling
  • Related