Danke.snafu hat geschrieben:Code: Alles auswählen
parser.feed(content.decode('utf-8'))
Die Suche ergab 2 Treffer
- Sonntag 13. April 2014, 23:50
- Forum: Netzwerkprogrammierung
- Thema: HTMLParser: Problem mit Umlauten
- Antworten: 4
- Zugriffe: 2445
Re: HTMLParser: Problem mit Umlauten
- Sonntag 13. April 2014, 12:29
- Forum: Netzwerkprogrammierung
- Thema: HTMLParser: Problem mit Umlauten
- Antworten: 4
- Zugriffe: 2445
HTMLParser: Problem mit Umlauten
Mit diesem Scipt
import urllib
from HTMLParser import HTMLParser
from htmlentitydefs import name2codepoint
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print "Start tag:", tag
for attr in attrs:
print " attr:", attr
def handle_endtag(self, tag):
print "End tag ...
import urllib
from HTMLParser import HTMLParser
from htmlentitydefs import name2codepoint
class MyHTMLParser(HTMLParser):
def handle_starttag(self, tag, attrs):
print "Start tag:", tag
for attr in attrs:
print " attr:", attr
def handle_endtag(self, tag):
print "End tag ...
