| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
10年前发布

找出所有链接的python脚本

import requests  import re    # get url  url = input('Enter a URL (include `http://`): ')    # connect to the url  website = requests.get(url)    # read html  html = website.text    # use re.findall to grab all the links  links = re.findall('"((http|ftp)s?://.*?)"', html)    # output links  for link in links:      print(link[0])