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

posted @ 2022-11-28 11:20  珊瑚贝博客  阅读(60)  评论(0编辑  收藏  举报