# -*- coding: utf-8 -*- #!/bin/env python import codecs import telnetlib, re from BeautifulSoup import BeautifulSoup conn = telnetlib.Telnet("letsmakerobots.com", 80) url = "http://letsmakerobots.com/shoutbox/js/view" conn.write("get "+url+"\n") data = conn.read_all() conn.close() out = ''.join(BeautifulSoup(data).findAll(text=True)) with codecs.open("filtered", "w", "utf-8-sig") as temp: temp.write(out)