在浏览器中从 Silverlight 控件中抓取数据 [英] Scraping Data from Silverlight Control within Browser

查看:37
本文介绍了在浏览器中从 Silverlight 控件中抓取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 Excel VBA 和 WPF 应用程序从各种网站抓取数据,一切顺利.但现在我遇到了一些我无法克服的事情.

I have been using Excel VBA and WPF applications to scrape data from various websites, and all has gone well. But now I have run into something I cant get past.

该网站正在 Silverlight 控件中显示其数据:

The website is displaying its data within a Silverlight control:

<OBJECT width="100%" height=400 id=rnSilverlightGrid 
data="data:application/x-oleobject;base64,QfXq3+...blah blah thousands of characters...AAAA==" 
type=application/x-silverlight-2
<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"></a>
</OBJECT>

(省略了我认为没有帮助的内容.)

(Left out what I thought was not helpful.)

getElementById("rnSilverlightGrid") 什么都不返回,但我可以使用 ie.document.all.tags("Object").Item(0),但一直无法深入对象获取数据.

getElementById("rnSilverlightGrid") returns nothing, but I am able to get a handle to the object with ie.document.all.tags("Object").Item(0), but have been unable to go further into the object to get data.

谁能告诉我现在如何从这个 Silverlight 网格中获取数据?这是目前在 Excel VBA 中编码的,但如有必要,我可以切换到 WPF 并使用 WebBrowser 控件.如果可以避免,我宁愿不进行切换(无论如何也不知道如何在那里进行).我调查了怀特(似乎是一个死胡同),并看到了其他有关此问题的未答复的问题.

Can anyone tell me how now to get the data out of this Silverlight grid? This is currently coded in Excel VBA, but if necessary I can switch to WPF and use the WebBrowser control. I would rather not make the switch if avoidable (not sure how to do it there either anyways). I looked into White (seems like a dead end), and have seen other questions about this which have gone unanswered.

提前致谢!

推荐答案

Silverlight 能够使某些对象可用于 JavaScript 调用,以便 JavaScript 开发人员可以从外部影响 Silverlight 应用程序.

Silverlight has the capability to make certain objects available to JavaScript calls so that JavaScript developers can affect the Silverlight application externally.

这些被称为可编写脚本的对象".

These are called "Scriptable Objects".

进一步阅读:https://msdn.microsoft.com/en-us/library/cc645085(v=vs.95).aspx

我的理解是此功能在 SL4 和 SL5 中可用.

My understanding is that this feature is available in SL4 and SL5.

这篇关于在浏览器中从 Silverlight 控件中抓取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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