perform search in google from c# application
-
My application has a WebBrowser object Inside a WebBrowser object i navigate to google site and from there a want to type something in the textbox and then press search button how can i achieve that? can anyone check this code?
WebBrowser_Main.Navigate("http://www.google.com/");
while (WebBrowser\_Main.IsBusy == true) { Application.DoEvents(); } HTMLDocument myDoc = new HTMLDocumentClass(); myDoc = (HTMLDocument)WebBrowser\_Main.Document; HTMLInputElement otxtSearchBox = (HTMLInputElement)myDoc.all.item("q", 0); otxtSearchBox.value = "code project"; HTMLInputElement btnSearch = (HTMLInputElement)myDoc.all.item("btnI", 0); btnSearch.click();
thanks
nelsonpaixao@yahoo.com.br trying to help & get help
-
My application has a WebBrowser object Inside a WebBrowser object i navigate to google site and from there a want to type something in the textbox and then press search button how can i achieve that? can anyone check this code?
WebBrowser_Main.Navigate("http://www.google.com/");
while (WebBrowser\_Main.IsBusy == true) { Application.DoEvents(); } HTMLDocument myDoc = new HTMLDocumentClass(); myDoc = (HTMLDocument)WebBrowser\_Main.Document; HTMLInputElement otxtSearchBox = (HTMLInputElement)myDoc.all.item("q", 0); otxtSearchBox.value = "code project"; HTMLInputElement btnSearch = (HTMLInputElement)myDoc.all.item("btnI", 0); btnSearch.click();
thanks
nelsonpaixao@yahoo.com.br trying to help & get help
You're going about it all wrong. If you want to add search capabilities to your own site or app, use the search API Google provides, here[^].
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
You're going about it all wrong. If you want to add search capabilities to your own site or app, use the search API Google provides, here[^].
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...i understand what you said, but i don´t want to do that google is a exemple, i what to login to one site using that type of code
nelsonpaixao@yahoo.com.br trying to help & get help
-
i understand what you said, but i don´t want to do that google is a exemple, i what to login to one site using that type of code
nelsonpaixao@yahoo.com.br trying to help & get help
I don't do screen scraping of web pages - it's just too inefficient for me... So what's not going right with the code you posted??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
I don't do screen scraping of web pages - it's just too inefficient for me... So what's not going right with the code you posted??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009..." Cannot convert type 'System.Windows.Forms.HtmlDocument' to 'mshtml.HTMLDocument' " it for a browsergame bots, i need to see the bot work i got the code from a project here but it uses a AxSHDocVw.AxWebBrowser and assemblers shdocvw and axshdocvw, i think is from old version for course if a change the project code it works i want do changes in code in order it to work in webbrowser object (not in AxSHDocVw.AxWebBrowser)
nelsonpaixao@yahoo.com.br trying to help & get help
-
" Cannot convert type 'System.Windows.Forms.HtmlDocument' to 'mshtml.HTMLDocument' " it for a browsergame bots, i need to see the bot work i got the code from a project here but it uses a AxSHDocVw.AxWebBrowser and assemblers shdocvw and axshdocvw, i think is from old version for course if a change the project code it works i want do changes in code in order it to work in webbrowser object (not in AxSHDocVw.AxWebBrowser)
nelsonpaixao@yahoo.com.br trying to help & get help
Good Luck with that...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Good Luck with that...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...solved :doh: i will use that axbrowser intead, i add to tools
nelsonpaixao@yahoo.com.br trying to help & get help