-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hierarchy request error #328
Comments
I have the same issue with other sites. I don't understand why there isn't any way to register an error event to prevent the exception from being thrown. |
I managed to fix it using the HTML5 node parser module in jsdom instead of the default. var HTML5 = require('html5'); |
I'm sorry but html5 parser still does not work for me.. I need something bulletproof, I need to parse a very nasty html!!! At least I should be able to catch the error so my script does not die!
|
Oh, I forgot to mention stopped jsdom from executing scripts via options. If that helps. |
Using this... should work!
|
I reported on this issue, see #290. Inspired by this post, I also tried the html5 parser. Code snippet:
This pattern can be found on the htlm5 github site. While I was able to pass in 'features' options (as detailed above), the jsdom.jQueryify function appears to overwrite the feature's settings. See jsdom.js (lines 122-4): 122 window.document.implementation.addFeature('FetchExternalResources', ['script']); Naturally, I wanted to set these to false to avoid script processing. My only option was to edited the code, setting all 3 features to false. It would be nice if the global defaultDocumentFeatures function worked as expected or the jQueryify function signature provided for options/features. |
I have this problem: Error: Invalid character: Invalid character in tag name: =. With either using HTML5 parser or not. |
Hello, everytime I try and access http://www.cracked.com using:
//Insert fetching the html body using the request module here. request(options, function(error, response, body){ if(!error && response.statusCode == 200){ try{ var window = jsdom.jsdom(body).createWindow(); window.document.getElementsByTagName('Body')[0].innerHTML+="PENIS"; var temp= window.document.innerHTML; console.log(temp); } catch(err) { console.log("ERROR "+err) } } });
I get the error:
.What is the cause of this?
The text was updated successfully, but these errors were encountered: