App/Model.py
def scrap_all_data(self, route):
        """
        Scrap all the data of a specific letter

        Args:
            route (str): Letter ID to scrap data

        Raises:
            exp: raise a generic exception if something goes wrong

        Returns:
            data (dict): dict with all the data of the specified letter
        """
        try:
            data = self.scrap_metadata(
                route, tag="div", attrs={"class": "content"})
            time.sleep(2)

            data['ORIGINAL'] = self.scrap_original_text(
                tag="div", attrs={"class": "content"}, route=route)
            time.sleep(2)

            data['TRANSLATION'] = self.scrap_translation_text(
                tag="div", attrs={"class": "content"}, route=route)
            time.sleep(2)

            data['NOTES'] = self.scrap_notes_text(
                tag="div", attrs={"class": "content"}, route=route)
            time.sleep(2)

            artworks = self.scrap_artworks(route)

            for key in artworks:
                if key != "ARTWORKSLINK":
                    for i in range(len(artworks[key])):
                        artworks[key][i] = self.clrtext(artworks[key][i])
                data[key] = ", ".join(artworks[key])

            for link, imgf in zip(artworks["ARTWORKSLINK"], artworks["ARTWORKSID"]):
                if len(link) and len(imgf):
                    self.get_artworks_images(route, link, imgf)

            return data
        except Exception as exp:
            Err.reraise(exp, "Gallery: scrap_all_data")

        Scrap all the data of a specific letter

        Args:
            route (str): Letter ID to scrap data

        Raises:
            exp: raise a generic exception if something goes wrong

        Returns:
            data (dict): dict with all the data of the specified letter
        
Scrap all the data of a specific letter
Scrap all the data of a specific letter
def scrap_all_data(self, route):
        try:
            data = self.scrap_metadata(
                route, tag="div", attrs={"class": "content"})
            time.sleep(2)
            data['ORIGINAL'] = self.scrap_original_text(
                tag="div", attrs={"class": "content"}, route=route)
            time.sleep(2)
            data['TRANSLATION'] = self.scrap_translation_text(
                tag="div", attrs={"class": "content"}, route=route)
            time.sleep(2)
            data['NOTES'] = self.scrap_notes_text(
                tag="div", attrs={"class": "content"}, route=route)
            time.sleep(2)
            artworks = self.scrap_artworks(route)
            for key in artworks:
                if key != "ARTWORKSLINK":
                    for i in range(len(artworks[key])):
                        artworks[key][i] = self.clrtext(artworks[key][i])
                data[key] = ", ".join(artworks[key])
            for link, imgf in zip(artworks["ARTWORKSLINK"], artworks["ARTWORKSID"]):
                if len(link) and len(imgf):
                    self.get_artworks_images(route, link, imgf)
            return data
        except Exception as exp:
            Err.reraise(exp, "Gallery: scrap_all_data")
def scrap_all_data ( self , route ) : try : data = self . scrap_metadata ( route , tag = "div" , attrs = { "class" : "content" } ) time . sleep ( 2 ) data [ 'ORIGINAL' ] = self . scrap_original_text ( tag = "div" , attrs = { "class" : "content" } , route = route ) time . sleep ( 2 ) data [ 'TRANSLATION' ] = self . scrap_translation_text ( tag = "div" , attrs = { "class" : "content" } , route = route ) time . sleep ( 2 ) data [ 'NOTES' ] = self . scrap_notes_text ( tag = "div" , attrs = { "class" : "content" } , route = route ) time . sleep ( 2 ) artworks = self . scrap_artworks ( route ) for key in artworks : if key != "ARTWORKSLINK" : for i in range ( len ( artworks [ key ] ) ) : artworks [ key ] [ i ] = self . clrtext ( artworks [ key ] [ i ] ) data [ key ] = ", " . join ( artworks [ key ] ) for link , imgf in zip ( artworks [ "ARTWORKSLINK" ] , artworks [ "ARTWORKSID" ] ) : if len ( link ) and len ( imgf ) : self . get_artworks_images ( route , link , imgf ) return data except Exception as exp : Err . reraise ( exp , "Gallery: scrap_all_data" )
Scrap all the data of a specific letter
Scrap all the data of a specific letter
"""
        Scrap all the data of a specific letter

        Args:
            route (str): Letter ID to scrap data

        Raises:
            exp: raise a generic exception if something goes wrong

        Returns:
            data (dict): dict with all the data of the specified letter
        """
data (dict): dict with all the data of the specified letter
data ( dict ) : dict with all the data of the specified letter
raise a generic exception if something goes wrong
raise a generic exception if something goes wrong
exp
self
route
Letter ID to scrap data
Letter ID to scrap data