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>
CodePudding user response:
for x in soup.find('i'):
soup.find('i').nextSibling