1

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.

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") 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.

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.

Thanks in advance!

1 Answer 1

1

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".

further reading: https://msdn.microsoft.com/en-us/library/cc645085(v=vs.95).aspx

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

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks Glenn, but unless you can tell me more, I am unable to use your answer. From within excel VBA, I have a handle (IHTMLElement) to the Silverlight control in the web browser on my desktop, I have no control over its version (which I believe is 3). I am not writing the SL control, I am trying to read the data it is displaying.
if the creator of the SL plugin didnt make functions available to you, then you cannot access them. sorry.
Do you mean javascript functions? I believe I can inject javascript into the control via DOM, eg., hItem.OnClick = "alert('hello there');"
Thanks again Glenn. I have decided to accept your answer that this is basically impossible with SL3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.