Hi.
I'm trying to simulate a click on a web page using Visual C++. I'm able to extract the contents of the page and get all the elements, but I can't get the click to work when the command (push) button on the web page can have a couple of values. Here's a snippet of my code:
I'm sure this is probably simple, put I need some help with it.
Thanks in advance.
I'm trying to simulate a click on a web page using Visual C++. I'm able to extract the contents of the page and get all the elements, but I can't get the click to work when the command (push) button on the web page can have a couple of values. Here's a snippet of my code:
Code:
// Set the name and index of the
// command button on the web page.
varID.SetString("DoThis");
varIdx.intVal = 0;
// Get all elements on the web page.
pNewDoc->get_all(&pElemColl);
hr = pElemColl->item(varID, varIdx, &pElemDisp);
if(SUCCEEDED(hr))
{
hr = pElemDisp->QueryInterface(IID_IHTMLElement, (void**)&pElem);
if(SUCCEEDED(hr))
{
// Obtained element with ID of "DoThis".
// Here is where I need to assign a Value to DoThis
// If it helps, in VB, the syntax is just DoThis.Value = "GetName"
// After the value is assigned, I want to click the DoThis element.
pElem->click();
pElem->Release();
}
}
Thanks in advance.