I have a file with a bunch of information. For example, all of the lines follow the same pattern as this:
<school>Nebraska</school>
I am trying to use the split function to only retrieve 'Nebraska'. This is what I have so far, but I'm not sure what to put to make it cut off both parts instead of just the first.
with open('Pro.txt') as fo:
for rec in fo:
print(rec.split('>')[1])
With this I get:
Nebraska</school
lxmlorBeautifulSoup. Don't try to roll your own XML parsing code.