ich benutze Beautiful Soup zum Parsen von HTML-Antwort Seiten auf individuelle Queries.
Das Problem ist, dass ich reproduzierbar nach etwa 2000 ausgewerteten Webseiten folgenden Fehler bekomme:
Ich übergebe die gesamte Website auf einen Schlag (sData) an Beautiful Soup. Als ich die Seiten damals ohne Beautiful Soup parste, gab nie einen MemoryError.Traceback (most recent call last):
File "./getall.py", line 71, in ?
main()
File "./getall.py", line 54, in main
trupdate.update_trouble(sUid, iCheckedInOnly=False, MySQL=MySQL)
File "./trupdate.py", line 89, in update_trouble
dTrouble = get_props(sUrl=sLink)
File "./troubleinfo.py", line 217, in get_props
Soup = soup_page(sUrl)
File "/home/ts8azt/scripts/beautifulsoup/soupgimmics.py", line 59, in soup_page
soup = BeautifulSoup(sData)
File "/home/ts8azt/scripts/beautifulsoup/BeautifulSoup.py", line 1282, in __init__
BeautifulStoneSoup.__init__(self, *args, **kwargs)
File "/home/ts8azt/scripts/beautifulsoup/BeautifulSoup.py", line 946, in __init__
self._feed()
File "/home/ts8azt/scripts/beautifulsoup/BeautifulSoup.py", line 971, in _feed
SGMLParser.feed(self, markup)
File "/python22/lib/python2.2/sgmllib.py", line 95, in feed
self.goahead(0)
File "/python22/lib/python2.2/sgmllib.py", line 129, in goahead
k = self.parse_starttag(i)
File "/python22/lib/python2.2/sgmllib.py", line 290, in parse_starttag
self.finish_starttag(tag, attrs)
File "/python22/lib/python2.2/sgmllib.py", line 321, in finish_starttag
self.unknown_starttag(tag, attrs)
File "/home/ts8azt/scripts/beautifulsoup/BeautifulSoup.py", line 1134, in unknown_starttag
tag = Tag(self, name, attrs, self.currentTag, self.previous)
File "/home/ts8azt/scripts/beautifulsoup/BeautifulSoup.py", line 415, in __init__
self.hidden = False
MemoryError
Es liegt die Vermutung nahe, dass sich innerhalb des Moduls irgendwelche Daten ansammeln, aber ich weiß nicht, wo ich ansetzen soll.
Kennt jemand das Problem? Oder kann mir jemand einen Tipp geben, wie ich den Speicherfresser aufspüren kann?
Vielen Dank für eure Hilfe! Gruß,
Michael