def googleSearch(self, term, numPages = 1): term = self.convertToUrlReady(term, 'google') links = [] for start in range(0,numPages): url = "http://www.google.com/search?q=" + term +"&start=" + str(start*10) page = Page(url) links.append(page.gSoupToLinks()) return links
def googleSearch(self, ending, numPages = 1): term = self.convertToUrlReady(ending) links = [] for start in range(0,numPages): url = "https://www.google.com/search?q=site:" + term +"+https&safe=active&start=" + str(start*10) page = Page(url) links.append(page.gSoupToLinks()) random_interval = random.randrange(15, 20, 1) print("sleeping for: " + str(random_interval) + " seconds") time.sleep(random_interval) return links