<s> from mechanize import Browser <EOL> from BeautifulSoup import BeautifulSoup <EOL> outfile = open ( "<STR_LIT>" , "<STR_LIT:w>" ) <EOL> mech = Browser ( ) <EOL> url = "<STR_LIT>" <EOL> page = mech . open ( url ) <EOL> html = page . read ( ) <EOL> soup = BeautifulSoup ( html ) <EOL> for row in soup . findAll ( '<STR_LIT>' , { "<STR_LIT:class>" : "<STR_LIT>" } ) : <EOL> name = row . find ( '<STR_LIT>' , { "<STR_LIT:class>" : "<STR_LIT>" } ) . a . string <EOL> street = row . find ( '<STR_LIT>' , { "<STR_LIT:class>" : "<STR_LIT>" } ) . span . string <EOL> city = street . findNext ( '<STR_LIT>' ) . string <EOL> record = ( name , street , city ) <EOL> print >> outfile , "<STR_LIT>" . join ( record ) <EOL> outfile . close ( ) </s>
