dimanche 10 juillet 2016

How to export array in csv or txt in Python


I'm trying to export array to txt or csv file. I've been trying with numpy but i always get some error like TypeError: Mismatch between array dtype ('<U14') and format specifier ('%.18e')

Here is my code without numpy that works great but I need help with part how to export it.

peoples = []
for content in driver.find_elements_by_class_name('x234'):
    people = content.find_element_by_xpath('.//div[@class="zstrim"]').text
    if people != "Django" and people != "Rooky" :
        pass
        peoples.append([people, 1, datetime.now().strftime("%d/%m/%y %H:%M")])
print(peoples)

Really need some help with this.


Aucun commentaire:

Enregistrer un commentaire