Lib/Recovery/Content.py
def scrap_at_position(self, tag="div", attrs={}, position=0, route=""):
        """
        Get the data at a specific position.

        Args:
            tag (str, optional): tag that elements must have. Default is div
            attrs (dict, optional): attributes that must have the tag. Default is empty
            position (int, optional): position of all the elemnts of the given tag to scrap. Default is 0
            route (str, optional): letter id to scrap. Default is ""

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

        Returns:
            ans (str): Text of the element of the given tag at the specific position
        """
        try:
            path = self.url.replace(".html", "/"+route+"/print.html")
            response = requests.get(path)
            body = BeautifulSoup(response.text, "html.parser")
            elements = body.find_all(tag, attrs=attrs)
            ans = ""
            if position < len(elements):
                ans = elements[position].text.replace("\n", " ")
            return ans
        except Exception as exp:
            Err.reraise(exp, "Page: scrap_at_position")

        Get the data at a specific position.

        Args:
            tag (str, optional): tag that elements must have. Default is div
            attrs (dict, optional): attributes that must have the tag. Default is empty
            position (int, optional): position of all the elemnts of the given tag to scrap. Default is 0
            route (str, optional): letter id to scrap. Default is ""

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

        Returns:
            ans (str): Text of the element of the given tag at the specific position
        
Get the data at a specific position.
Get the data at a specific position .
def scrap_at_position(self, tag="div", attrs={}, position=0, route=""):
        try:
            path = self.url.replace(".html", "/"+route+"/print.html")
            response = requests.get(path)
            body = BeautifulSoup(response.text, "html.parser")
            elements = body.find_all(tag, attrs=attrs)
            ans = ""
            if position < len(elements):
                ans = elements[position].text.replace("\n", " ")
            return ans
        except Exception as exp:
            Err.reraise(exp, "Page: scrap_at_position")
def scrap_at_position ( self , tag = "div" , attrs = { } , position = 0 , route = "" ) : try : path = self . url . replace ( ".html" , "/" + route + "/print.html" ) response = requests . get ( path ) body = BeautifulSoup ( response . text , "html.parser" ) elements = body . find_all ( tag , attrs = attrs ) ans = "" if position < len ( elements ) : ans = elements [ position ] . text . replace ( "\n" , " " ) return ans except Exception as exp : Err . reraise ( exp , "Page: scrap_at_position" )
Get the data at a specific position.
Get the data at a specific position .
"""
        Get the data at a specific position.

        Args:
            tag (str, optional): tag that elements must have. Default is div
            attrs (dict, optional): attributes that must have the tag. Default is empty
            position (int, optional): position of all the elemnts of the given tag to scrap. Default is 0
            route (str, optional): letter id to scrap. Default is ""

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

        Returns:
            ans (str): Text of the element of the given tag at the specific position
        """
ans (str): Text of the element of the given tag at the specific position
ans ( str ) : Text of the element of the given tag at the specific position
raise a generic exception if something goes wrong
raise a generic exception if something goes wrong
exp
self
tag
tag that elements must have. Default is div
tag that elements must have . Default is div
attrs
attributes that must have the tag. Default is empty
attributes that must have the tag . Default is empty
position
position of all the elemnts of the given tag to scrap. Default is 0
position of all the elemnts of the given tag to scrap . Default is 0
route
letter id to scrap. Default is ""
letter id to scrap . Default is " "