python:获取html网页里面的url链接
import re import requests r = request.get('http://www.163.com') data = r.text link_list = re.findall(r"(?<=href=\").+?(?=\")", data) for url in link_list: print(url)
参考:http://www.shanhubei.com/archives/2489.html
import re import requests r = request.get('http://www.163.com') data = r.text link_list = re.findall(r"(?<=href=\").+?(?=\")", data) for url in link_list: print(url)
参考:http://www.shanhubei.com/archives/2489.html