Skip to content Skip to sidebar Skip to footer

Extracting Data From Anchor Tags Using Regex In Python

I'm trying to extract the hyperlinks from a webpage using regex in Python. suppose my text string is: text = 'ALL/n

ElementTree example:

from xml.etree import ElementTree

tree = ElementTree.parse('filename.html')
for elem in tree.findall('a'):
    print ElementTree.tostring(elem)

Post a Comment for "Extracting Data From Anchor Tags Using Regex In Python"