mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-24 22:42:56 +08:00
lgtm fixes and a few other fixes
This commit is contained in:
parent
94de2f6423
commit
9c9e6f2d9a
1 changed files with 8 additions and 13 deletions
|
@ -19,11 +19,9 @@ def __init__(self, word, limit, start):
|
|||
self.counter = start
|
||||
|
||||
def do_search(self):
|
||||
try: # Do normal scraping.
|
||||
# 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)
|
||||
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)
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue