lgtm fixes and a few other fixes

This commit is contained in:
Jay Townsend 2019-09-15 13:32:29 +01:00
parent 94de2f6423
commit 9c9e6f2d9a

View file

@ -19,11 +19,9 @@ def __init__(self, word, limit, start):
self.counter = start
def do_search(self):
try: # Do normal scraping.
urly = 'http://' + self.server + '/search?num=' + self.quantity + '&start=' + str(
self.counter) + '&hl=en&meta=&q=%40\"' + self.word + '\"'
except Exception as e:
print(e)
# Do normal scraping.
urly = 'http://' + self.server + '/search?num=' + self.quantity + '&start=' + str(
self.counter) + '&hl=en&meta=&q=%40\"' + self.word + '\"'
try:
headers = {'User-Agent': googleUA}
r = requests.get(urly, headers=headers)
@ -37,17 +35,14 @@ def do_search(self):
return
else:
self.results = google_workaround(urly)
except BaseException:
except Exception:
pass
time.sleep(getDelay())
self.totalresults += self.results
def do_search_profiles(self):
try:
urly = 'http://' + self.server + '/search?num=' + self.quantity + '&start=' + str(
self.counter) + '&hl=en&meta=&q=site:www.google.com%20intitle:\"Google%20Profile\"%20\"Companies%20I%27ve%20worked%20for\"%20\"at%20' + self.word + '\"'
except Exception as e:
print(e)
urly = 'http://' + self.server + '/search?num=' + self.quantity + '&start=' + str(
self.counter) + '&hl=en&meta=&q=site:www.google.com%20intitle:\"Google%20Profile\"%20\"Companies%20I%27ve%20worked%20for\"%20\"at%20' + self.word + '\"'
try:
headers = {'User-Agent': googleUA}
r = requests.get(urly, headers=headers)
@ -61,7 +56,7 @@ def do_search_profiles(self):
return
else:
self.results = google_workaround(urly)
except BaseException:
except Exception:
pass
time.sleep(getDelay())
self.totalresults += self.results
@ -155,7 +150,7 @@ def send_dorks(self): # Helper function to minimize code reusability.
return
else:
self.results = google_workaround(link)
except BaseException:
except Exception:
pass
time.sleep(getDelay())
self.totalresults += self.results