LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Websites

I am trying to access a website to copy in a request and then push the submit button on the website.  I can open the website and get the xml document handle.  But I can seem to get access to the element inside the document.  I have tried this in LabWindows and LabView.  Looking on the web, I found examples in Python, ASP.net and C#.

 

What am I missing?

 

lResult = SHDocVw_NewInternetExplorerIWebBrowser2(NULL, 1, LOCALE_NEUTRAL, 0, &IWebBrowserObjectHandle);   /* new handle to control */ 
lResult = SHDocVw_IWebBrowser2Navigate2(IWebBrowserObjectHandle, &stErrorInfo, vURLString,  DEFAULT, DEFAULT, DEFAULT, DEFAULT);  /* open website */

lResult = SHDocVw_IWebBrowser2GetDocument(IWebBrowserObjectHandle, &stErrorInfo, &IWebPageDocHandle);   /* get document */

lResult = MSHTML_IHTMLDocument2Getforms(IWebPageDocHandle, &stErrorInfo, &IWebPageFormHandle);   /* get form in document */
   

lResult = CA_VariantSetCString(&vRequestForm, "taRequest");    /* create a variant of name of location on website */

lResult = CA_VariantSetCString(&vSubmitButton, "btnSubmit");    /* create a variant of submit button */

0 Kudos
Message 1 of 3
(3,185 Views)

if the page you retrieve is written using HTML, there is a good chance it is not valid XML.  XML enforces well-formedness, while HTML does not. on the other hand, XHTML is valid XML. verify that the result you retrieve is well-formed.

0 Kudos
Message 2 of 3
(3,162 Views)
The data coming back is in XML format.
0 Kudos
Message 3 of 3
(3,154 Views)