I have following problem: I have some HTML code and I need to get tag content. I don't want to use millions of substring or something like that. I want to use regex but I am having problem with filtering tags with classes, ids,... or without anything. Here's my regex:
match = re.search('(?<=<span(.+)?>)(.*)(?=</span>)', '<span class="red">color</span>')
Python throws following error
sre_constants.error: look-behind requires fixed-width pattern
I want to get content from
<span class="red">color</span>
and from
<span>color</span>
Thanks everyone from help!