Skip to content

Instantly share code, notes, and snippets.

@MikeChongCan
Created April 20, 2016 02:00
Show Gist options
  • Select an option

  • Save MikeChongCan/5cf2fd26c1141d617afa81938f35420f to your computer and use it in GitHub Desktop.

Select an option

Save MikeChongCan/5cf2fd26c1141d617afa81938f35420f to your computer and use it in GitHub Desktop.
React Native: Parsing/Crawling HTML
# React Native: Parsing/Crawling HTML
## Ugly Way
[xmldom](https://www.npmjs.com/package/xmldom) + [xpath](https://www.npmjs.com/package/xpath)
## Much Better Way
[cheerio][https://www.npmjs.com/package/cheerio].
Note: You MUST also install `buffer`, `events` and `stream` to avoid dependency errors.
In the past, cheerio uses `fs` so that it is not possible to use it in the environment of react native. But now it works fine.
Just enjoy it!
Sample App for it: [Den](https://github.com/asamiller/den) .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment