From ded438f75013f6542b5936d83d962c6189547950 Mon Sep 17 00:00:00 2001 From: Jing Ling Date: Sat, 1 Aug 2020 13:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/search/baidu.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/search/baidu.py b/modules/search/baidu.py index 3004055..f17c461 100644 --- a/modules/search/baidu.py +++ b/modules/search/baidu.py @@ -13,11 +13,10 @@ class Baidu(Search): self.domain = domain self.limit_num = 750 # 限制搜索条数 - def redirect_match(self, domain, html): + def redirect_match(self, html): """ 获取跳转地址并传递地址进行跳转head请求 - :param domain: 域名 :param html: 响应体 :return: 子域 """ @@ -52,7 +51,7 @@ class Baidu(Search): return if len(domain) > 12: # 解决百度搜索结果中域名过长会显示不全的问题 # 获取百度跳转URL响应头的Location字段获取直链 - subdomains = self.redirect_match(domain, resp.text) + subdomains = self.redirect_match(resp.text) else: subdomains = self.match_subdomains(resp.text, fuzzy=False) if not subdomains: # 搜索没有发现子域名则停止搜索 @@ -106,4 +105,4 @@ def do(domain): # 统一入口名字 方便多线程调用 if __name__ == '__main__': - do('huayunshuzi.com') + do('mi.com')