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 is part of the standard library
- BeautifulSoup is a popular 3rd party library
- lxml is a fast and feature-rich C-based library.
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"