最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ios - Best way to Web-scrape and inject JavaScript using React Native? - Stack Overflow

programmeradmin1浏览0评论

I recently started using React Native to work on an app that involves web scraping. We've been using a ponent called the React Native WebView Bridge, which is similar to the UIWebViewBridge library in Obj-C but has some problems. Since React Native is asynchronous, we've been having trouble returning info in that the App calls the render function with the WebView Bridge often and unpredictably. Sometimes the WebView Bridge module will call our injected javascript 1 time, and sometimes it will call 3 times.

Is there a better way to scrape info and inject javascript effectively in React Native?

Here's a link to the WebViewBridge for React Native that we used.

I recently started using React Native to work on an app that involves web scraping. We've been using a ponent called the React Native WebView Bridge, which is similar to the UIWebViewBridge library in Obj-C but has some problems. Since React Native is asynchronous, we've been having trouble returning info in that the App calls the render function with the WebView Bridge often and unpredictably. Sometimes the WebView Bridge module will call our injected javascript 1 time, and sometimes it will call 3 times.

Is there a better way to scrape info and inject javascript effectively in React Native?

Here's a link to the WebViewBridge for React Native that we used.

Share Improve this question edited Jun 21, 2016 at 0:50 metacore asked Jun 20, 2016 at 22:28 metacoremetacore 911 gold badge1 silver badge9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

I've used cheerio to parse HTML content from a website, transform it into JSON and use that to feed a React ponent. This way you get the benefits of using React Native, and not just a hybrid web app.

You can find an example of it in this React Native app: https://github./stan229/ClubReadyApp

发布评论

评论列表(0)

  1. 暂无评论