I use a VBA macro (in Excel) to navigate a website and gather some data from a webpage. In this case Excel is just a container but I didn't have any other easy way to write a program :) Now I have found the portable version of SharpDevelop and I'd like to rewrite this small application in .NET using C# but I have a problem.
In VBA I can access Javascript variables directly using, for example:
result = WebBrowser1.Document.frames(0).tabTime
where WebBrowser1 is my WebBroser component and tabTime is a Javascript array. The type of result is Variant/string, but that's OK, I can manipulate that string easily.
In .NET I have to add a Window to reach the frame, like that:
HtmlWindow myFrame = webBrowser1.Document.Window.Frames[0];
Now I have the frame but I didn't find a way to access the javascript variable tabTime. I have already tried with no success:
myFrame.tabTime;
myFrame.Document.tabTime;
myFrame.DomWindow.tabTime;
dynamic p = myFrame.Document.InvokeScript("eval", new object[] { "tabTime" });
Any ideas?