C# Why does Web browser Drop Down Does Not Update The Price?
I have a program that automatically selects each value inside a drop-down
list and copy each of their own price.
The problem I have is that, even though my program selected a particular
value--that particular value did not show its own particular price.
This is the code that I am using:
foreach (HtmlElement htmlElement in
this.webBrowser2.Document.GetElementsByTagName("select"))
{
if (htmlElement.OuterHtml.Contains("msku-sel-1"))
{
htmlElement.Focus();
// htmlElement.RaiseEvent("onClick");
htmlElement.InvokeMember("Click");
htmlElement.SetAttribute("value", "3");
//webBrowser2.Document.InvokeScript("(a)");
}
}
This is the link of the website that I am applying it on:
http://www.ebay.com/itm/Keurig-Tullys-French-Roast-Decaf-18-or-180-K-Cups-/111042016413?
So based on that code above, it can highlight and select the Box Size,
which is 48. It should also update and show the price, but it did not.
Now if you manually click the drop down menu, and select 48, the price
would turn to "US $39.47"
As I dug the website's source code even deeper using Opera Internet
Browser, I noticed it had an event listener, which contains the following
code:
function(a){return typeof f!="undefined"&&
(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b}
This is the part where I need help with. If you could please recreate the
code that I am using, you will notice it will successfully select the
right value, but it does not seem to update the price. How do I update the
price even though I already selected the value?
No comments:
Post a Comment