使用lxmlimpoprt lxml.htmlroot = lxml.html.fromstring(response_content_string)for a in root.cssselect('a[href]'): print(a)或者impoprt lxml.htmlroot = lxml.html.fromstring(response_content_string)for el, attr, url, _ in root.iterlinks(): print(url)