Logo Search packages:      
Sourcecode: webcheck version File versions

def crawler::Link::follow_link (   self,
  visited = None 
)

If this link represents a redirect return the redirect target,
otherwise return self. If this redirect does not find a referenced
link None is returned.

Definition at line 588 of file crawler.py.

00588                                        :
        """If this link represents a redirect return the redirect target,
        otherwise return self. If this redirect does not find a referenced
        link None is returned."""
        # if this is not a redirect just return
        if self.redirectdepth == 0:
            return self
        # if we don't know where this redirects, return None
        if len(self.children) == 0:
            return None
        # len(self.children) should be 1!
        # set up visited
        if visited is None:
            visited = []
        # check for loops
        visited.append(self)
        if self.children[0] in visited:
            return None
        # check where we redirect to
        return self.children[0].follow_link(visited)

    def _pagechildren(self):


Generated by  Doxygen 1.6.0   Back to index