I have a list which is in this certain format.
[u' ', u'Address :',u'Sadar Bazaar',u'new Delhi,India',u' ',u'Name :',u'Saun-Jean',u' ',u'Occupation :',u'Developer',u'Hacker',u' ']
I want to Insert Records into Database.
Here is my thought ,How to do it.
1) Take all items between two u' '
2) The second item u'Address' defines the field of the Database and rest up-to next u' ' defines the data.
like
'Address :','Sadar Bazaar','new Delhi,India'
3)Repeat this procedure for all Items.
There may be other good ideas.
But i don’t know how to do it in Python.Can someone help me do it??
Edit:
Here is how i constructed the List:
for tr in browser.find_elements_by_xpath("//tbody//tbody//tr"):
tds=tr.find_elements_by_tag_name('td')
if tds:
data.append([td.text for td in tds])
output: