3 ms·
This is a great idea! phantomjs-node works okay, but it is suck a hack. A nifty hack, but still. https://github.com/sgentle/phantomjs-node#how-does-it-work http
by lancefisher 14y ago
This is a great idea! phantomjs-node works okay, but it is suck a hack. A nifty hack, but still. https://github.com/sgentle/phantomjs-node#how-does-it-work https://github.com/sgentle/phantomjs-node#how-does-it-work
If you want to parse the DOM for the internet at large, you need a real browser. There are simply too many sites with really bad HTML to be parsed reliably with anything else.
- catch23 14y agoIf you need a great html parser, I also wrote a library for one of those: https://github.com/deanmao/node-hubbub https://github.com/deanmao/node-hubbub It's merely an integration library for the netsurf browser. It's the html parser for a real browser. I considered using the parser from other browsers like firefox or webkit, but netsurf had the fewest external dependencies.
- salmanapk 14y agoJust in case this saves someone's time: phantomjs-node uses ridiculous hacks. Not being rude but I think the author was drunk when writing that. I ended up wasting quite some time when trying to customize it. You do NOT need to use any hacks whatsoever to run dnode on phantom, just browserify(https://github.com/substack/node-browserify https://github.com/substack/node-browserify) the shoe and dnode modules and use the example code at https://github.com/substack/dnode https://github.com/substack/dnode .