# -*- coding: utf-8 -*-
import urllib2
import re

#connect to a URL
website = urllib2.urlopen("http://www.baidu.com")
#read html code
html = website.read()
#use re.findall to get all the links
links = re.findall('"((http|ftp)s?://.*?)"', html)  ###".*?"任意匹配
print links

  

相关文章:

  • 2022-02-07
  • 2021-11-20
  • 2021-12-28
  • 2021-12-26
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-11-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-08-19
  • 2022-12-23
  • 2021-06-02
相关资源
相似解决方案