Skip to content
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

Does not inject for content type text/xml, please fix line 389? #243

Closed
nolandg opened this issue Nov 5, 2017 · 1 comment
Closed

Does not inject for content type text/xml, please fix line 389? #243

nolandg opened this issue Nov 5, 2017 · 1 comment

Comments

@nolandg
Copy link
Contributor

nolandg commented Nov 5, 2017

When you crawl documents of type text/xml, the "response body is not HTML, skip injecting" warning is triggered and no cheerio/jsdom is injected.

I propose changing crawler.js:389 to:
if (!options.html && !typeis(contentType(response), ['html','xhtml','text/xml'])){
(include the 'text/xml')

When this is done, cheerio is injected and the XML document is parsed correctly and res.$ works great.

Thanks for the great package!

@mike442144
Copy link
Collaborator

hey, it seems good, could you open a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants