Okay well I have been trying to make a visual basics program that buys a product when it is available. So the program inserts the text box product number into the form and then clicks check availability, without reloading the page, a second button appears if the product on the website is available. And then the second button is then clicked. If the second button doesn't exist yet the program loops and starts over again until the second button is available. This code is currently what I have. The program begins to loop and then freezes. Any help would be appreciated.
What I have so far
These are the buttonsCode:WebBrowser2.Document.GetElementById("product").SetAttribute("value", TextBox3.Text) Do Until WebBrowser2.DocumentText.Contains("button id=""BuyIt""") WebBrowser2.Document.GetElementById("checkAvailability").InvokeMember("click") Loop WebBrowser2.Document.GetElementById("BuyIt").InvokeMember("click")
Code:<button id="checkproduct" type="submit" style="display: inline"> Check Availability of Product </button> <button id="buyIt" type="submit" style="display: none"> Buy it </button>


Reply With Quote