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

Bad HTML to bad JSON issue (some notes to save you time) #110

Closed
davidroman0O opened this issue Sep 20, 2019 · 0 comments
Closed

Bad HTML to bad JSON issue (some notes to save you time) #110

davidroman0O opened this issue Sep 20, 2019 · 0 comments

Comments

@davidroman0O
Copy link

davidroman0O commented Sep 20, 2019

Hi,

First of all, thank you a lot for your work, it's an amazing library!

It's not an issue for the repo but a note to future user of you library 😄

I use himalaya for some times now and I've made a lot of scrapping things at scale.

If you want to quickly iterate on the JSON, use traverse.

If you have issues with the JSON being incorrect, it's probable because the HTML page is not well formatted and even himalaya can't parse it properly, it may be a really special case or a human mistake. So, for this issue use DOMPurify BEFORE using parse of himalaya.

You'll lose some performance but you'll gain more confort and a proper parsing of your HTML pages.

One more thing, use as much as asynchronous things as possible AND when using traverse, please make a cache and do not use traverse(json) each time, do const cache = traverse(json); instead. (cache.get(....) etc...)

Have fun, this library is really awesome and combined with the right processes, methodologies and other libraries, it's a really life saver!

Thank you @andrejewski for making this library, your hard work is impressive 😉

I'm closing this "issue" immediately! 😅

PS : you should add a way to support financially this library

@davidroman0O davidroman0O changed the title Bad HTML to bad JSON issue Bad HTML to bad JSON issue (some notes to save you time) Sep 20, 2019
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

1 participant