fork download
  1. import re
  2. html = "<a href='link.html'>URL</a>Some text <!-- Comment --><p>Par here</p>More text"
  3. text_list = list(filter(None, re.findall(r'(?s)<!--.*?-->|>(.*?)<', html)))
  4. print(text_list)
Success #stdin #stdout 0.03s 9576KB
stdin
Standard input is empty
stdout
['URL', 'Some text ', 'Par here']