def walk(self):
        """walk the dom tree and get the info of the page"""
        g = self.doc.recursiveChildGenerator()
        while True:
            try:
                tag = g.next()
                if not isinstance(tag,unicode):
                    if tag.name == "a" and ((self.is_foreign and len(tag.text) > 10) or (not self.is_foreign and len(tag.text) > 4)):
                        self.link_num += 1
                        self.link_text_len += len(tag.getText())
                    elif TEXT_TAG_COLLECTION.has_key(tag.name):
                        tag_text = tag.contents[0] if len(tag.contents) > 0 and isinstance (tag.contents[0], unicode) else ""
                        if len(tag_text) > 0:
                            self.text_tag_num += 1
                            self.text_tag_text_len += len(tag_text)
                else:
                    self.total_text_len += len(tag)
            except StopIteration:
                break