gatherproxy.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:rental 作者: meihuanyu 项目源码 文件源码
def parse_page(self, response):
        pattern = re.compile('gp.insertPrx\((.*?)\)', re.S)
        items = re.findall(pattern, response.body)
        for item in items:
            data = json.loads(item)
            #?????????
            port = data.get('PROXY_PORT')
            port = str(int(port, 16))

            proxy = Proxy()
            proxy.set_value(
                    ip = data.get('PROXY_IP'),
                    port = port,
                    country = data.get('PROXY_COUNTRY'),
                    anonymity = data.get('PROXY_TYPE'),
                    source = self.name,
            )

            self.add_proxy(proxy = proxy)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号