Example #1
0
    def handle_starttag(self, tag, attrs):
        # Injects the needed tags to find the right result when it identifies
        # The type of result being handled
        if self.found_root_path and tag == 'div':
            for attr in attrs:
                if attr[0] == 'class':
                    if attr[1] == 'thanks':
                        self.add_path_conditioned_node("table",
                                                       [('id', 'bugheader')])
                        self.add_path_conditioned_node("tr", [('id', 'title')])
                        self.found_root_path = False
                        self.quit_on_done = True
                        self.result_type = 'success'
                    elif attr[1] == 'error':
                        self.add_path_conditioned_node("div",
                                                       [('class', 'error')])
                        self.found_root_path = False
                        self.quit_on_done = True
                        self.result_type = 'error'
                    elif attr[1] == 'warning':
                        self.add_path_conditioned_node("div",
                                                       [('class', 'warning')])
                        self.found_root_path = False
                        self.quit_on_done = True
                        self.result_type = 'warning'

        HTMLGetData.handle_starttag(self, tag, attrs)
    def handle_starttag(self, tag, attrs):
        # Injects the needed tags to find the right result when it identifies
        # The type of result being handled
        if self.found_root_path and tag == 'div':
            for attr in attrs:
                if attr[0] == 'class':
                    if attr[1] == 'thanks':
                        self.add_path_conditioned_node("table",[('id','bugheader')])
                        self.add_path_conditioned_node("tr",[('id','title')])
                        self.found_root_path = False
                        self.quit_on_done = True
                        self.result_type = 'success'
                    elif attr[1] == 'error':
                        self.add_path_conditioned_node("div",[('class','error')])
                        self.found_root_path = False
                        self.quit_on_done = True
                        self.result_type = 'error'
                    elif attr[1] == 'warning':
                        self.add_path_conditioned_node("div",[('class','warning')])
                        self.found_root_path = False
                        self.quit_on_done = True
                        self.result_type = 'warning'

        HTMLGetData.handle_starttag(self, tag, attrs)