I'm trying to scrape some data from a website and have manage to collect the important information out yet when I am printing it into an excel file the data just flows into one column. Is there a solution from the code provided or will i need to create multiple outcomes and then print those out.
I'm very new to web scraping, I've tried to use .join
which has just put all the data into one row which I want, however its all concatenated into a single column
totals = page_soup.findAll("p", {"class":"b-fight-details__table-text"})
for i in totals:
stats = i.text.replace("\n"," ")
print(stats, end= " ")
f.write(stats)
f.close()
Stephen Thompson Anthony Pettis 0 1 47 of 107 32 of 55 43% 58% 47 of 107
Output is currently this, however it is all stuck in one column I want it to be as below, obviously i will have headers in the code for the output
Fighter A Fighter B KD TKD S TS
Stephen Thompson Anthony Pettis 0 1 47 of 107 32 of 55 43% 58% etc...