Im trying to extract the data which is under EXPERIENCE tag. Im using beautifulsoup to extract the data. Below is my html:
<div><span>EXPERIENCE
<br/></span></div><div><span>
<br/></span></div><div><span>
<br/></span></div><div><span></span><span> </span><span>I worked in XYZ company from 2016 - 2018
<br/></span></div><div><span> I worked on JAVA platform
<br/></span></div><div><span>From then i worked in ABC company
</br>2018- Till date
</br></span></div><div><span>I got handson on Python Language
</br></span></div><div><span>PROJECTS
</br></span></div><div><span>Developed and optimized many application, etc...
My work till now:
with open('E:/cvparser/test.html','rb') as h:
dh = h.read().splitlines()
out = str(dh)
soup = BeautifulSoup(out,'html.parser')
for tag in soup.select('div:has(span:contains("EXPERIENCE"))'):
final = (tag.get_text(strip = True, separator = '\n'))
print(final)
Expected Output:
I worked in XYZ company from 2016 - 2018
I worked on JAVA platform
From then i worked in ABC company
2018- Till date
I got handson on Python Language
For my code its returning null. Can someone help me out here?
<span>tag. So you are looking for the data under thespantag that contains the text/contentEXPERIENCE