Bug fix for --proxy-file (only first element was fetched in case of fail)

This commit is contained in:
Miroslav Stampar
2015-09-25 15:23:42 +02:00
parent 4774795d8c
commit f16389232f
2 changed files with 28 additions and 14 deletions

View File

@@ -48,7 +48,7 @@ class Google(object):
self.opener.addheaders = conf.httpHeaders
try:
conn = self.opener.open("http://www.google.com/ncr")
conn = self.opener.open("https://www.google.com/ncr")
conn.info() # retrieve session cookie
except Exception, ex:
errMsg = "unable to connect to Google ('%s')" % getSafeExString(ex)
@@ -66,7 +66,7 @@ class Google(object):
if not dork:
return None
url = "http://www.google.com/search?"
url = "https://www.google.com/search?"
url += "q=%s&" % urlencode(dork, convall=True)
url += "num=100&hl=en&complete=0&safe=off&filter=0&btnG=Search"
url += "&start=%d" % ((gpage - 1) * 100)
@@ -176,3 +176,6 @@ class Google(object):
retVal = [urllib.unquote(match.group(1)) for match in re.finditer(regex, page, re.I | re.S)]
return retVal
def setHTTPProxy(): # Cross-linked function
raise NotImplementedError