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.splitlines() should give you just that.
names.splitlines()