My question is simply: if neither of the above commands work on splitting up a string into multiple lines, does that mean that nothing is delimiting the string?
My example is pretty in depth but in short: I have parsed specific data out of an HTML table with BeautifulSoup, but when I go to print the data it is all one messy string instead of a neat table format. I tried converting it to a Pandas DataFrame but still no success. I then tried using the above commands to neaten up the output but those also failed. This all leads me to believe it must in fact be one continuous string with no delimiters (even though obviously in the table they are separate entries).
I would love help with this problem. I am not sure if I'm using the commands wrong, or if my data really is this difficult to work with. Thank you.
My data (and how I expect it should be printed):
My relevant code:
rows = table.findAll("tr")[1:2]
data = {
'ID' : [],
'Available Quota' : [],
'Live Weight Pounds' : [],
'Price' : [],
'Date Posted' : []
}
for row in rows:
cols = row.findAll("td")
data['ID'].append(cols[0].get_text())
data['Available Quota'].append(cols[1].get_text())
data['Live Weight Pounds'].append(cols[2].get_text())
data['Price'].append(cols[3].get_text())
data['Date Posted'].append(cols[4].get_text())
fishData = pd.DataFrame(data)
#print(fishData)
str1 = ''.join(data['Available Quota'])
#print(type(str1))
#str1.split("\n")
str1.splitlines()
print(str1)
What gets printed:
GOM CODGOM HADDDABSGOM YT