I have extracted a set of data from HTML page and copied to a variable. The variable looks like
names=\'\'\' Apple Ball Cat\'\'\' >
names=\'\'\' Apple Ball Cat\'\'\'
names.split('\n') should give you a list split by '\n'
names.split('\n')