c# - how to search keyword in different website using google searching -


i want search keyword in google. have tried following code enter keyword , click search button through c# program.

    private void webform_load(object sender, eventargs e)     {             webbrowser1.height = 1000;             webbrowser1.width = 1000;             this.controls.add(webbrowser1);             webbrowser1.documentcompleted += new webbrowserdocumentcompletedeventhandler(webbrowser_documentcompleted);             this.webbrowser1.navigate("www.google.com.au");        } 

my documentcompleted method is:

    public void webbrowser_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e)     {         var webbrowser = sender webbrowser;         webbrowser.documentcompleted -= webbrowser_documentcompleted;         htmlelement textelement = webbrowser.document.all.getelementsbyname("q")[0];         textelement.setattribute("value", "mlm company");         htmlelement btnelement = webbrowser.document.all.getelementsbyname("btng")[0];         btnelement.invokemember("click");      } 

now can go through different links of google search page..... want email, title , url of websites searched , retrieved google through code. can url of every website. problem is, how search email, title in every website because every website have different structure....

i have tried following code unsuccessful.

htmlnode mytd3 = mydocument4.documentnode.selectsinglenode(@"//html/body/article/section/section[2]/section[2]/ul/li[1]"); htmlnode mytd4 = mydocument4.documentnode.selectsinglenode(@"//html/body/article/section/section[2]/div/p[2]"); 

why don't instead create google alert , create recipe in ifttt write results of google search file in dropbox? can parse contents of text file in dropbox folder.

here sample ifttt recipe might need: https://ifttt.com/recipes/66982


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -