def filterLinks(self, data):
        x = Html()

        tree = x.feed(data)

        """the step 1 filters all the tags which start with p or ul(unordered list)
           since all content on wiki are inside those two kind of tags.
        """

        step1 = [ind for ind in tree.sail()
                        if ind.name == 'div'
                            if ind.attr['id'] == 'bodyContent']

        bodyContent = step1[0]

        step2 = [ind for ind in bodyContent.sail()
                        if ind.name == 'p' or ind.name == 'ul']


        step3 = [indj for indi in step2
                        for indj in indi.sail()
                            if indj.name == 'a']


        step4 = [ind for ind in step3
                            if self.isWikiLink(ind.attr['href'])]


    
        step5 = [ind.attr['href'] for ind in step4]                    

        return step5
dataset/ETHPy150Open iogf/ehp/sample/ex6.py/WikiGraph.filterLinks/original