I am trying to Write some data in a CSV file using Selenium
While running the Code
labels = browser.find_elements_by_xpath('.//a[@class="question-hyperlink"]')
text = [x.text for x in labels]
data.append(text)
print(text)
with open('output.csv', 'wb') as data_file:
writer = csv.writer(data_file)
writer.writerows(data)
the output am getting is
data1 data2 data3 data4 data5
data6 data7 data8 data9 data10
data11 data12 data13 data14 data15
But I want to write the data as below
data1
data2
data3
data4
.....
data15
How can I do that?
please help me.