File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -564,11 +564,21 @@ def __init__(self):
564564 sgmllib .SGMLParser .__init__ (self )
565565
566566 def start_a (self , attributes ):
567+ self .link_attr (attributes , 'href' )
568+
569+ def end_a (self ): pass
570+
571+ def do_img (self , attributes ):
572+ self .link_attr (attributes , 'src' , 'lowsrc' )
573+
574+ def do_frame (self , attributes ):
575+ self .link_attr (attributes , 'src' )
576+
577+ def link_attr (self , attributes , * args ):
567578 for name , value in attributes :
568- if name == 'href' :
579+ if name in args :
569580 if value : value = string .strip (value )
570581 if value : self .links [value ] = None
571- return # match only first href
572582
573583 def do_base (self , attributes ):
574584 for name , value in attributes :
@@ -578,7 +588,6 @@ def do_base(self, attributes):
578588 if verbose > 1 :
579589 print " Base" , value
580590 self .base = value
581- return # match only first href
582591
583592 def getlinks (self ):
584593 return self .links .keys ()
You can’t perform that action at this time.
0 commit comments