Hello,
I'm trying to use the Microsoft Web Browser (IWebBrowser2) and Script (IScriptControl) activeX controls in Labview to evaluate and execute HTML script. If I wire the web browser control's document object to the object input of the Script control's AddObject method, I can then evaluate/execute script such as "document.f.btnI.focus();" and such (in this case corresponding to Google's home page). However, there are other expressions that include the "window" object that are proving much more difficult to work with. Although I can browse the document object's parentWindow object via the property browser, if I try to access that object programatically, I get the error "Error -2147467262 occurred at No such interface supported". I'm wondering how to include the window object for scripting.
I'm writing a content-oriented web crawler. I've been writing it with pretty low level TCP functions, handling 301/302 "object moved" and "<META HTTP-EQUIV="refresh" CONTENT="0; url=http://millercountyliberal.com/">" redirections manually. But there are other automatic script-based redirections like:
<script language="JavaScript" type="text/javascript">
<!-- window.location="
http://www.jrnl.com" -->
</script>
that I'm still trying to figure out how to work with. As you can see, to work with that one manually involves the window object. The reason that I don't just let the Web Browser object handle the redirections is because that object often throws script errors, downloads embedded graphics and other unnecessary components, can't handle some non-standard redirections, and sometimes annoyingly crashes. Any help would be appreciated. A code sample is attached. The Web Browser control should already exist on your machine if you have Internet Explorer installed. The script control may need to be registered before it can be used as follows:
regsvr32 "c:\MyDir\XHTTP.dll"
Thanks.