From b850641e85cab31db38f3ea918f759eb5d93dfee Mon Sep 17 00:00:00 2001 From: 5a43 Date: Sun, 26 Jun 2016 14:46:29 +0800 Subject: [PATCH] add code to handle the situation that only using js to redirect --- lib/utils/search.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/utils/search.py b/lib/utils/search.py index 35b315552..7ffc86d04 100644 --- a/lib/utils/search.py +++ b/lib/utils/search.py @@ -142,8 +142,16 @@ def _search(dork): try: r = requests.get(baidu_link, timeout=10) if r and r.status_code == 200: - logger.info(r.url) - retVal.append(r.url) + # baidu will just use Javascript to redirect the page rather than responding a 302 HTTP code. + if r.history: + logger.info(r.url) + retVal.append(r.url) + else: + m = re.search('