标签:http sp on bs ad html ef as tt
# -*- coding: cp936 -*-
import urllib2
import re
def u(url):
#connect to a URL
website = urllib2.urlopen(url)
#read html code
html = website.read()
#use re.findall to get all the links
links = re.findall(‘"((http|ftp)s?://.*?)"‘, html)
print u‘有:‘,len(links),u‘个‘
url=raw_input(‘url:‘)
u(url)
标签:http sp on bs ad html ef as tt
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4146133.html