def adopt(self, grab):
        """
        Copy the state of another `Grab` instance.

        Use case: create backup of current state to the cloned instance and
        then restore the state from it.
        """

        self.load_config(grab.config)

        self.doc = grab.doc.copy(new_grab=self)

        for key in self.clonable_attributes:
            setattr(self, key, getattr(grab, key))
        self.cookies = deepcopy(grab.cookies)
def adopt ( self , grab ) : self . load_config ( grab . config ) self . doc = grab . doc . copy ( new_grab = self ) for key in self . clonable_attributes : setattr ( self , key , getattr ( grab , key ) ) self . cookies = deepcopy ( grab . cookies )
Copy the state of another `Grab` instance.

        Use case: create backup of current state to the cloned instance and
        then restore the state from it.