I have a variable like the one below:
var = '<img src="path_1"><p>Words</p><img src="path_2>'
Its a string, but inside is obviously html elements. How do I get the first path only (i.e. path_1) using a regex?
I am trying something like this:
match = re.match(r'src=\"[\w-]+\"', var)
print match.group(0)
I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'group'
Any help is appreciated.