scrapper.py
def run(self):
        """
        ============================================
        receive a class name that will be used for
        search images using google images tool
        ============================================
        """
        
        url = "https://www.google.com.br/search?q="+self.class_name+"&prmd=inv&source=lnms&tbm=isch&sa=X&ved=0ahUKEwj3mdzbnrXZAhWQuFMKHY7DAbYQ_AUIESgB#imgrc=_"
        path_webdriver = "C:\\webdrivers\\chromedriver.exe"
        driver = webdriver.Chrome(path_webdriver)
        driver.get(url)
        
        print("Get a coffe, while I search the images for you")

        # IMPORTANT!: the scrolls are necessary to render more images on the screen for scrap
        base_jump, jump_size = 1000, 200
        for i in range(20):
            driver.execute_script('window.scrollTo(0, '+str(base_jump + jump_size)+');')
            jump_size += 200
            time.sleep(1)

        html = driver.page_source
        bsobj = BeautifulSoup(html, 'html5lib')
        image_list = bsobj.findAll('img',{'class':'rg_ic rg_i'})

        image_src_list = []
        for image in image_list:
            try:
                image_src_list.append(image.attrs['src'])
            except:
                print('failed to found the source of %s...' % image.get_text()[:self.max_string_size])
            
        driver.close()
        print('%s found, starting the download!' % str(len(image_src_list)))
        self.download_images(image_src_list)

        ============================================
        receive a class name that will be used for
        search images using google images tool
        ============================================
        
receive a class name that will be used for
search images using google images tool
receive a class name that will be used for search images using google images tool
def run(self):
        url = "https://www.google.com.br/search?q="+self.class_name+"&prmd=inv&source=lnms&tbm=isch&sa=X&ved=0ahUKEwj3mdzbnrXZAhWQuFMKHY7DAbYQ_AUIESgB#imgrc=_"
        path_webdriver = "C:\\webdrivers\\chromedriver.exe"
        driver = webdriver.Chrome(path_webdriver)
        driver.get(url)
        print("Get a coffe, while I search the images for you")
        base_jump, jump_size = 1000, 200
        for i in range(20):
            driver.execute_script('window.scrollTo(0, '+str(base_jump + jump_size)+');')
            jump_size += 200
            time.sleep(1)
        html = driver.page_source
        bsobj = BeautifulSoup(html, 'html5lib')
        image_list = bsobj.findAll('img',{'class':'rg_ic rg_i'})
        image_src_list = []
        for image in image_list:
            try:
                image_src_list.append(image.attrs['src'])
            except:
                print('failed to found the source of %s...' % image.get_text()[:self.max_string_size])
        driver.close()
        print('%s found, starting the download!' % str(len(image_src_list)))
        self.download_images(image_src_list)
def run ( self ) : url = "https://www.google.com.br/search?q=" + self . class_name + "&prmd=inv&source=lnms&tbm=isch&sa=X&ved=0ahUKEwj3mdzbnrXZAhWQuFMKHY7DAbYQ_AUIESgB#imgrc=_" path_webdriver = "C:\\webdrivers\\chromedriver.exe" driver = webdriver . Chrome ( path_webdriver ) driver . get ( url ) print ( "Get a coffe, while I search the images for you" ) base_jump , jump_size = 1000 , 200 for i in range ( 20 ) : driver . execute_script ( 'window.scrollTo(0, ' + str ( base_jump + jump_size ) + ');' ) jump_size += 200 time . sleep ( 1 ) html = driver . page_source bsobj = BeautifulSoup ( html , 'html5lib' ) image_list = bsobj . findAll ( 'img' , { 'class' : 'rg_ic rg_i' } ) image_src_list = [ ] for image in image_list : try : image_src_list . append ( image . attrs [ 'src' ] ) except : print ( 'failed to found the source of %s...' % image . get_text ( ) [ : self . max_string_size ] ) driver . close ( ) print ( '%s found, starting the download!' % str ( len ( image_src_list ) ) ) self . download_images ( image_src_list )
receive a class name that will be used for
search images using google images tool
receive a class name that will be used for search images using google images tool
"""
        ============================================
        receive a class name that will be used for
        search images using google images tool
        ============================================
        """ # IMPORTANT!: the scrolls are necessary to render more images on the screen for scrap
self