def test_search(self): google = GooglePage(self.driver) google.open() google.search("porno nalgonas") self.assertEqual("porno nalgonas", google.keyword)
def test_search(self): google = GooglePage(self.driver) google.open() google.search('Platzi') self.assertEqual('Platzi', google.keyword)
def google_page(driver): base_url = "https://www.google.com" driver.get(base_url) yield GooglePage(driver) driver.close()
output_excel_file = data.get("output_excel_file") num_to_download = data.get("num_to_download") headless = data.get("headless") excel_handler = ExcelHandler(output_excel_file) # Get keywords excel_parser = ExcelParser(excel_file) keywords = excel_parser.get_keywords() # Init a webdriver instance driver = MyDriver.chrome_driver(headless) driver = init_driver(driver) # Go to image search page search_page = GooglePage(driver) search_page.go_to_img_search_page() row = 1 try: for idx, keyword in enumerate(keywords): if idx >= start_index - 1: print("Number {}: {}".format(idx + 1, keyword)) # generate folder to store images img_folder = get_img_folder(idx + 1, keyword, platform) # folder = generate_folder_by_time(img_folder, platform) folder = img_folder # Search images by keyword search_page.search_img_by_keyword(keyword) # Get images data from page img_data_list = search_page.get_images(keyword,
def test_search_dtt(self): google = GooglePage(self.driver) google.open() google.search('Github') self.assertEquals('Github', google.keyword)
def test_search(self): google = GooglePage(self.driver) google.open() google.search('fyupanquia') self.assertEqual('fyupanquia', google.keyword)