Robots

Gerhard Häring gerhard.nospam at bigfoot.de
Thu Feb 15 00:06:39 CET 2001


> >Are you trying to fill a spam database? If so, you deserve a good kick
> >in your ass. Perhaps this would help you.
> 
> LOL! No, sorry that I misled you! I want to contact webmasters individually
> with individualized emails and invite them to swap links. So... any ideas
> on a script?

You are a lucky guy! ;-)

Fiddling with HTML is always fun. What about the following for a start?

Gerhard

--- attempt #1 follows ---

#!/usr/bin/env python
import re

class MailGrabber:
    def __init__( self ):
        self.mail_adrs = []
        self.mail_regex = re.compile( 'mailto:.*?"' )

    def handle_doc( self, s ):
        for result in re.findall( self.mail_regex, s ):
            result = result[ len( "mailto:" ) : -1 ]
            self.mail_adrs.append( result )            
            
grabber = MailGrabber()

f = open( 'c://tmp//namenliste.htm', 'r' )
s = f.read()
f.close()

grabber.handle_doc( s )
print grabber.mail_adrs

-- 
Sorry for the fake email, please use the real one below to reply.
contact: g e r h a r d @ b i g f o o t . d e
web:     http://highqualdev.com



More information about the Python-list mailing list