Mr Pingaling

Here is my problem. If I place an order on one item and then order then same item again, Amazon.com will ask me to verify if I want to place duplicate order or cancel the duplicate one. I simply find "cancelOrder" button and try to use HtmlElement.InvokeMember("click") to click the button. But it will not work and jump back to previous place order page. Why is this last step not working while all other steps work fine when using the same method to place ordrers. Can anyone help me Thank you.

foreach (HtmlElement input in webBrowser.Document.GetElementsByTagName("input"))
{
if (input.Name == "cancelOrder") input.InvokeMember("click");
}

Below is the page:

<form method="POST" action="/gp/checkout/duplicate-order/select.html/102-9927819-2125755" onSubmit="return(doubleClickPrevention_onSubmit());" >
<input type="hidden" name="purchaseTotal" value="18.36" / >
<input type="hidden" name="purchaseTotalCurrency" value="USD" / >
<tr><td><b>Please choose one:</b></td></tr>
<tr><td align="center"><input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/checkout/duplicate-order/place-this-duplicate-order.gif" width="225" align="absmiddle" alt="Place your order" value="Place Your Order" name="forcePlaceOrder" height="25" border="0" /></td></tr>
<tr><td align="center" class="tiny">or</td></tr>
<tr><td align="center">
<input type="image" src="https://images-na.ssl-images-amazon.com/images/G/01/x-locale/checkout/duplicate-order/cancel-this-duplicate-order.gif" width="225" align="absmiddle" alt="Cancel this duplicate order" value="Cancel this duplicate order" name="cancelOrder" height="25" border="0" />
</td></tr>
<tr><td align="center" class="tiny">(Your original order will still be shipped; we'll take you to Your Account to view your order history)</td></tr>
</form>



Re: Internet Explorer Extension Development Problem with HtmlElement.InvokeMember at Amazon.com

Sheng Jiang

You can create a mouse event and dispatch it. For an example, see http://developer.mozilla.org/en/docs/DOM:element.dispatchEvent.




Re: Internet Explorer Extension Development Problem with HtmlElement.InvokeMember at Amazon.com

Anonymous1234454

I know this is an old thread but I have the same problem. All the other buttons work but "ForcePlaceOrder" brings me back to the place your order page. Does anyone know whats causing this and how to make the button work




Re: Internet Explorer Extension Development Problem with HtmlElement.InvokeMember at Amazon.com

Wiiiiiii

can anyone help




Re: Internet Explorer Extension Development Problem with HtmlElement.InvokeMember at Amazon.com

Anonymous1234454

I am using this

for creating internet explorer object
ie=win32com.client.Dispatch('InternetExplorer.Application')

find button and execute "click"
ie.Document.getElementsByName ('forcePlaceOrder')[0].click()

and we encounter the same error.




Re: Internet Explorer Extension Development Problem with HtmlElement.InvokeMember at Amazon.com

Anonymous1234454

I'll pay someone if they give me the code (Python or COM interface) that is able to click this button correctly.




Re: Internet Explorer Extension Development Problem with HtmlElement.InvokeMember at Amazon.com

Sheng Jiang

IHTMLElement element=(IHTMLElement )input.DomElement;

element.Click();