C#WebBrowser脚本错误 [英] C# webBrowser script error

查看:131
本文介绍了C#WebBrowser脚本错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用 webBrowser.Navigate("https://home.nest.com/")加载页面时,我一直收到脚本错误.它可以从我的常规Internet浏览器中正常运行,但不能在我的程序中运行.

I keep getting a script error when trying to load the page using webBrowser.Navigate("https://home.nest.com/"). It will pull up fine from my normal internet browser but not in my program.

有人能指出我正确的方向吗?

Can anyone point me in the right direction?

推荐答案

即使在使用版本11的情况下,集成Internet Explorer WebBrowser 控件中的脚本错误始终发生.大量的Javascript文件和动态渲染.您可以通过在常规浏览器中观看该页面加载来看到这一点.该控件有时无法削减它.

The script errors happen all of the time in the integrated Internet Explorer WebBrowser control even when it's using version 11. Modern websites rely heavily on massive Javascript files and dynamic rendering. You can see that just by watching that page load in a regular browser. The control just can't cut it some of the times.

您可能想尝试一些替代的浏览器控件.无法保证它可以与其中任何一个一起使用,但至少可以尝试一下.

You might want to try some alternative browser controls. There are no guarantees that it will work with any of them, but at least it's something to try.

  • Awesomium :最初基于Chromium.我不知道它们是否仍集成了Chromium更改或是否朝着自己的方向发展.它是免费的,个人使用的以及商业收入少于10万美元的手机都是免费的.
  • DotNetBrowser :将基于Chromium的WPF/WinForms组件嵌入.NET应用程序中,以显示现代Web使用HTML5,CSS3,JavaScript,Silverlight等构建的页面.
  • geckofx :一个用于将Mozilla Gecko(Firefox)嵌入.NET应用程序的开源组件.li>
  • Xilium.CefGlue :嵌入了Chromium的.NET/Mono绑定框架(CEF),作者:Marshall A. Greenblatt.
  • BrowseEmAll: BrowseEmAll.Cef (Chrome),BrowseEmAll Core API (Chrome,Firefox,IE-COMMERCIAL)
  • Awesomium : Originally based on Chromium. I don't know if they still integrate Chromium changes or if they've gone in their own direction. It's free for personal use as well as commercial making less than $100k.
  • DotNetBrowser : Embed a Chromium-based WPF / WinForms component into your .NET application to display modern web pages built with HTML5, CSS3, JavaScript, Silverlight etc.
  • geckofx : An open-source component for embedding Mozilla Gecko (Firefox) in .NET applications.
  • Xilium.CefGlue : A .NET/Mono binding for The Chromium Embedded Framework (CEF) by Marshall A. Greenblatt.
  • BrowseEmAll : BrowseEmAll.Cef (Chrome), BrowseEmAll.Gecko (Firefox), BrowseEmAll Core API (Chrome,Firefox,IE - COMMERCIAL)

可能还有其他一些,但是如果您想走这条路线,这应该使您从一些较流行的活跃项目开始.

There are probably others, but this should give you a start with some of the more popular active projects if you want to pursue this route.

这篇关于C#WebBrowser脚本错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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