I am writing a Python + Selenium script to scrap Linkedin site.
I read the profile summary using this statement, which works properly:
profileDescription = profile.find_element_by_xpath("div/div[1]").text
My problem is with the non english data coming from the site.
I am writing the data scrapped from the site to an excel using this code:
with open('search.csv', 'ab') as csvfile:
self.liSearchOutWriter = csv.writer(csvfile, delimiter=',')
self.liSearchOutWriter.writerow([profileDescription])
Whenever description contains non-english data, it does not display properly in the excel. I read through unicode and utf8 resources, but could not get a grip on it.
Can someone help me understand how I should modify my code in order to display non english data properly?
codecs.open.