通用正则, 抓取a标签href属性

import re # url通用匹配 url_regex = re.compile('<a[^>]+href=["\'](.*?)["\']', re.IGNORECASE) # test url_str = "<a type='akfdf' href='http://www.itmeng.top' xxxx>hahah</a>" result = url_regex.findall(url_s
相关文章
相关标签/搜索