如何在本机中获取WebView对象的html源代码(How to get the html source of WebView object in react native)
我正在尝试访问第三方网页的HTML源代码,以读取在react-native中的WebView组件中加载的页面的特定DOM元素值。
<WebView source={{uri: 'https://www.amazon.com'}} />
并假设有一个像这样的DOM元素:
<span class="price bold some-class-name">$459.00</span>
我也试过这个组件但是不能这样做: https : //github.com/alinz/react-native-webview-bridge
有没有办法在WebView和Read特定的DOM元素值中获取页面的当前HTML源代码?
I'm trying to access the HTML source code of a 3rd party web page to read a specific DOM element value of a page which is loaded in WebView component in react-native.
<WebView source={{uri: 'https://www.amazon.com'}} />
and Suppose there's a DOM element like this:
<span class="price bold some-class-name">$459.00</span>
I also tried this component but could not do that: https://github.com/alinz/react-native-webview-bridge
Is there any way to get the current HTML source code of page inside a WebView and Read specific DOM element value?
原文:https://stackoverflow.com/questions/41294300
最满意答案
Windows 10中存在API更改。您似乎应该使用BackgroundMediaPlayer.Current.SystemMediaTransportControls。 这还没有在文档中。 您可以在Windows 10示例存储库中找到它: https : //github.com/Microsoft/Windows-universal-samples/tree/master/backgroundaudio
There is an API change in Windows 10. It seems that you should use BackgroundMediaPlayer.Current.SystemMediaTransportControls. This is not in the documentation yet. You can find it in the Windows 10 sample repository: https://github.com/Microsoft/Windows-universal-samples/tree/master/backgroundaudio
相关问答
更多-
使用UWP从C#运行EXE(Running an EXE from C# using UWP)[2023-01-09]
我一整晚都把头撞在一堵砖墙上,但是在上网了几百页之后,我可能已经想出了解决我的问题的办法。 通过参考“参考>通用Windows>扩展”下的“UWP v10.0.14393.0的Windows桌面扩展”,我可以使用: await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(); LaunchFullTrustProcess允许我从我自己的应用程序中启动一个受信任的应用程序。 然后,我修改了Package Manifest ... -
我下载并检查了你的代码,一切都很正确,除了你为你的主项目添加后台任务参考 你需要添加 BackgroundPlayer 引用你的mainproject(musictest) I downloaded and checked your code,everything is proper except you dint add background task reference to your main project You need to do add BackgroundPlayer refernce t ...
-
正如在对话中发现的那样,问题在于项目类型的错误声明。 应该是Windows运行时组件 。 对于粉丝,请看一下这个答案 ,它描述了这些步骤。 它回答了Silverlight 8.1 ,但WinRT和UWP中的过程和步骤是相同的。 As it turned out in the conversation, the problem was in wrong declaration of project type. In should be a Windows Runtime Component. For the ...
-
经过我的研究......没有机会只用javascript来构建和完成它。 目前......在周年纪念更新(2016年,8月)之后有机会 - 微软员工确认这是可能的,我们可以通过这个例子探索他们提供: https : //github.com/Microsoft/Windows-universal- samples / tree / dev / Samples / BackgroundMediaPlayback ... so ...会等到看:) After research i made... there i ...
-
uwp directx和c#开发(uwp directx and c# development)[2022-05-28]
好的,我同意你的意见,这只是关于着色器 vs_4_0_level_9_1 ps_4_0_level_9_1和 使用(D3D11.Device defaultDevice = new D3D11.Device(D3D.DriverType.Hardware,D3D11.DeviceCreationFlags。None)) 在这里输入图像描述 ok i agreee with you, it's just about de shader vs_4_0_level_9_1 ps_4_0_level_9_1 and ... -
如果我使用Window.Current.Content = new SplitShellPage(rootFrame); 代替Window.Current.Content = rootFrame; SplitView可以工作,但后退按钮不起作用 在这种情况下,您当前使用的框架是shell_splitview.Content 。 因为您使用此代码进行导航(shell_splitview.Content as Frame).Navigate(typeof(MainPage)); 。 因此,在App.xaml.c ...
-
Windows 10中存在API更改。您似乎应该使用BackgroundMediaPlayer.Current.SystemMediaTransportControls。 这还没有在文档中。 您可以在Windows 10示例存储库中找到它: https : //github.com/Microsoft/Windows-universal-samples/tree/master/backgroundaudio There is an API change in Windows 10. It seems tha ...
-
UWP后台任务取消(UWP Background Task Cancellation)[2022-02-16]
根据MSDN,后台任务限制为30秒: 后台任务限制为30秒的挂钟使用。 您的后台任务在25收到取消通知,然后它有5秒钟完成其工作并调用deferal.Complete方法。 如果您拒绝取消在Run方法中Run的代码,则您的任务将在5秒后终止。 因此,我认为在您的情况下,您会收到取消通知,但运行方法中的代码会在不到5秒的时间内保持运行并达到finally状态,并且您的任务成功完成而不会终止。 请注意,取消令牌源不一定会立即取消run方法中的代码。 您的代码可能处于取消令牌没有立即生效的位置。 Backgrou ... -
“ExectionTimeExceeded”是否与设备的CPU相关? 根据后台任务取消原因枚举,对于ExecutionTimeExceeded它说: 后台任务已取消,因为它超出了分配的运行时间。 在UWP中,后台任务确实有CPU约束,CPU需要保证10%。 更多限制,您可以参考本PPT的幻灯片22。 但是对于ExecutionTimeExceeded取消原因,它应该由“挂钟配额”的约束引起。 除了渴望触发(运行25秒和取消5秒)之外,后台任务限制为30秒的挂钟使用。 因此,您的后台任务应该执行少于25秒,如 ...
-
弄清楚了。 更改了upload.method =“PUT”; //在C#代码中默认为POST 将PHP脚本更改为:
相关文章
更多- Web scraper open source
- Object Oriented Programming
- Open Source Search Engines in Java
- Hadoop的本地库(Native Libraries)介绍
- 编译Hadoop-2.0.3的native
- reading notes for solr source code
- 微信支付开发(11) Native支付
- Hadoop Could not load native gpl library异常解决
- Guava学习笔记:复写的Object常用方法
- Hadoop的tasktracker启动失败,重编译native库
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)