一个简单的爬网页内容程序

from urllib.request import urlopen
def f1(url):
    def f2():
        # print(url)
        print(urlopen(url).read())
    return f2
f=f1("%s%s"%("http://",input("输入你要爬得网站:")))  #例如输入-->www.baidu.com
f()

  

原文地址:https://www.cnblogs.com/mrpengfei/p/6716266.html