3 ms·
I don't think anything is going to work on every web page in existence. Perhaps strlen.
by lacker 18y ago
I don't think anything is going to work on every web page in existence. Perhaps strlen.
- andrewljohnson 18y agoYeah, since i just wrote a spider last night using html5lib, and had to wrap it up in a try block, I can categorically say that it doesn't work for all webpages: parser = html5lib.HTMLParser(tree=treebuilders.getTreeBuilder("beautifulsoup")) try: document = parser.parse(response) except Exception, e: print 'parse failed ' + str(e) return
- s3graham 18y agoAnd strlen certainly wouldn't if you actually expect a correct answer. Can't guess at encodings... :)