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

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()

  

posted @ 2017-04-15 23:14  im777  阅读(199)  评论(0编辑  收藏  举报