everyone. I finished putting 4 attributes (publicationtitle,publicationurl,publicationdate,publicationdescription) in the first 4 columns in my csv file and also the detailed information below. How can I start putting another 3 attributes in the next 3 columns and their detailed information in the output csv file.(As you can see, the first 4 attributes and second 3 attributes are from different looping system)
import csv
from bs4 import BeautifulSoup
fconn=open('D:\\Resumes\\Resume1.html')
html=fconn.read()
fconn.close()
tree=BeautifulSoup(html)
publication=tree.findAll('div',{'class':'publication-section'})
with open('D:\\ResumesClassification\\test.csv', 'wb') as csvfile:
publicationwriter=csv.writer(csvfile,dialect='excel')
publicationwriter.writerow(['publicationtitle']+['publicationurl']+['publicationdate']+['publicationdescription'])
for i in publication:
publicationtitle=i.find('p',{'class':'publication_title'})
if publicationtitle!=None:
publicationtitle=publicationtitle.text
publicationtitle=publicationtitle.encode('ascii','ignore')
else:
publicationtitle="publication title not metioned"
......
publicationwriter.writerow([publicationtitle,publicationurl,publicationdate,publicationdescription])
workexperience=tree.findAll('div',{'class':'work-experience-section'})
for i in workexperience:
.....(just like the publication stuff, there are titles, dates and descriptions)