18910140161

爬虫5 html下载器html_downloader.py

顺晟科技

2021-10-01 12:17:51

162

#coding:utf8
import urllib2

__author__ = \'wang\'


class HtmlDownloader(object):
    def download(self, url):
        if url is None:
            return None

        response = urllib2.urlopen(url)

        if response.getcode() != 200:
            return None

        return response.read()

 

相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航