mirror of
https://github.com/laramies/theHarvester.git
synced 2024-09-20 23:37:00 +08:00
Made user agent for initial request to duckduckgo api constant.
This commit is contained in:
parent
5c64cb38f8
commit
d684e22171
|
@ -242,7 +242,7 @@ def sendTCPRequest(self, server):
|
|||
|
||||
class DnsAsyncRequest(DnsRequest, asyncore.dispatcher_with_send):
|
||||
|
||||
" an asynchronous request object. out of date, probably broken "
|
||||
" an asynchronous request object. out of date, probably broken "
|
||||
|
||||
def __init__(self, *name, **args):
|
||||
DnsRequest.__init__(self, *name, **args)
|
||||
|
|
|
@ -21,7 +21,7 @@ def __init__(self, word, limit):
|
|||
def do_search(self):
|
||||
try: # do normal scraping
|
||||
url = self.api.replace('x', self.word)
|
||||
headers = {'User-Agent': getUserAgent()}
|
||||
headers = {'User-Agent': googleUA}
|
||||
r = requests.get(url, headers=headers)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
@ -74,6 +74,8 @@ def crawl(self, text):
|
|||
return tmp
|
||||
except Exception as e:
|
||||
print('Exception occurred: ' + str(e))
|
||||
import traceback as t
|
||||
print(t.print_exc())
|
||||
return []
|
||||
|
||||
def get_emails(self):
|
||||
|
@ -85,4 +87,4 @@ def get_hostnames(self):
|
|||
return rawres.hostnames()
|
||||
|
||||
def process(self):
|
||||
self.do_search() # only need to search once since using API
|
||||
self.do_search() # only need to search once since using API
|
||||
|
|
Loading…
Reference in a new issue