How can I cause webbrowser to click on a website button?

  • Thread starter Thread starter Questions For VB
  • Start date Start date
Q

Questions For VB

Guest
Hello, I want to say in advance: Thanks to everyone who responds to this message. This forum has been so helpful for me to date and my appreciation is great.


I am working on a program that works with a particular website. They just changed their website dramatically and now my program isnt working. I want the webbrowser to enter a search term into an input box. That I can do. I want it to then push the SEARCH button. That is where I am having trouble. Here is the code I was using that USED to work on the old website:

dim search_key as string

searchkey=datagridview1.item(0,current_item).valueWebBrowser8.Document.GetElementById("value").SetAttribute("value", search_key)WebBrowser8.Document.All("Search").InvokeMember("click")


That no longer works. Below is the code from the html page that I am trying to work with. Does anyone have suggestions on how I can tell the webbrowser to push that button? THANKS in advance!

<div class="search
<form id="search_mini_form" action="https://www.bigtreats.com/catalogsearch/result/" method="get
<div class="form-search
<div class="input-wrapper
<input id="search" type="text" name="q" value="" class="input-text" maxlength="128"/>
<button type="submit"title="Submit" class="button <span><span>Submit</button>


Using the following line doesnt work: WebBrowser8.Document.All("Submit").InvokeMember("click")

Thanks again!

Continue reading...
 
Back
Top