Replaced r.content with r.text in googlesearch to work properly.

This commit is contained in:
NotoriousRebel 2018-11-19 15:57:42 -05:00
parent 35bbfeaf44
commit d38b1c4473
3 changed files with 12 additions and 11 deletions

View file

@ -33,13 +33,14 @@ def do_search(self):
self.totalresults += self.results
def do_search_api(self):
h = http.client.HTTPConnection(self.apiserver)
h.putrequest('GET', "/xml.aspx?Appid=" + self.bingApi + "&query=%40" +
self.word + "&sources=web&web.count=40&web.offset=" + str(self.counter))
h.putheader('Host', "api.search.live.net")
h.putheader('User-agent', self.userAgent)
h.endheaders()
self.results = str(h.getresponse().read())
url = 'http://' + self.server + "/xml.aspx?Appid="+self.bingApi+"&query=%40" + \
self.word + "&sources=web&web.count=40&web.offset=" + str(self.counter)
headers = {
'Host': "api.search.live.net",
'User-agent': self.userAgent
}
h = requests.get(url=url, headers=headers)
self.results = str(h.content)
self.totalresults += self.results
def do_search_vhost(self):

View file

@ -36,10 +36,11 @@ def do_search(self):
print(e)
try:
params = {'User-Agent': random.choice(self.userAgent)} #select random user agent
r=requests.get(urly,params= params)
r=requests.get(urly,params=params)
except Exception as e:
print(e)
self.results = str(r.content)
self.results = r.text
#print('self.results: ', self.results)
self.totalresults += self.results
def do_search_profiles(self):
@ -51,7 +52,7 @@ def do_search_profiles(self):
r=requests.get(urly)
except Exception as e:
print(e)
self.results = r.content
self.results = r.text
#'&hl=en&meta=&q=site:www.google.com%20intitle:"Google%20Profile"%20"Companies%20I%27ve%20worked%20for"%20"at%20' + self.word + '"')
self.totalresults += self.results

View file

@ -134,7 +134,6 @@ def start(argv):
search = googlesearch.search_google(word, limit, start)
search.process(google_dorking)
all_emails = search.get_emails()
print('all_emails is: ',all_emails)
all_hosts = search.get_hostnames()
for x in all_hosts:
try: