在react-native中将HTML转换为JSON [英] Convert HTML to JSON in react-native

查看:314
本文介绍了在react-native中将HTML转换为JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将网络请求中收到的HTML转换为JSON,这样我就可以轻松读取这些值.
如果有一种方法可以直接从HTML读取值,请在评论中让我知道
我找到了这个库: https://github.com/andrejewski/himalaya
但是当我尝试在我的应用程序中运行示例时,出现错误Cannot read property prototype of undefined,因此我认为该库在react-native中不起作用,因为它包含核心Node JS模块.
这是代码:

I want to convert the HTML I received from a network request to JSON so I can easily read the values.
If there is a way to read values straight from HTML please let me know in a comment
I have found this library: https://github.com/andrejewski/himalaya
but when I try to run the example in my app I get the error Cannot read property prototype of undefined so I assume this library doesn't work in react-native because it contains a core Node JS module.
This was the code:

这篇关于在react-native中将HTML转换为JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆