11-18-2008 02:41 PM
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 */
11-20-2008 04:03 AM
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.
11-20-2008 08:00 AM