This blog post is going to be really short, and if you happen to have stumbled up on it, hopefullly I’ve got some answers for you. However, I’m really just writing this post because I want to bookmark this information for my future self! haha
With a lot of web scraping technologies, they’re typically intended to be run on a desktop computer or a server that’s able to simulate a web browser. However, setting up your project like this is going to cost you some money to do because you’ll need to spin up a server instance that you have to pay for each month. I have a massive graveyard of dead projects that I’ve had to kill off because I couldn’t afford the server costs. So personally, I’ve been trying to build things that truly don’t need a server and can operate without a centralized backend that costs me money each month.
And fortunately, I discovered a couple of guys on the internet that have run into the same problems and created a solution that you can use in your React-Native apps.
- Check out Gift Banda’s Web Scraping in React-Native on Medium
- And take the cheerio-without-node-native library for a spin
Cheerio-without-node-native is a fork of the cheerio webscraping library that removes/replaces the modules that make cheerio incompatible in a client-side environment.
I’m sure there are some downsides to doing this client side. I imagine that some things that involve JavaScript rendering and what not you probably won’t be able to do client-side. My guess though is you’ll probably be able to scrape 50 to 80 percent of the stuff you could normally scrape with cheerio.
I haven’t actually used this library yet, so we’ll see if it actually can get the job done. If not, I suppose I’ll just setup a server and a backend and all of that the old fashioned way.