2013-06-26 31 views
0

我有一個關於自動訪問網站的項目:www.alexa.com並將網站(在文本框中輸入)的結果(流量排名,頁面排名)提交給C#碼。 您能告訴我如何在www.alexa.com頁面的文本框中輸入網址,然後按submit automaticaly?那我怎樣才能把結果? 請!!! 首先,我有一個函數來訪問www.alexa.com頁:在網站的文本框中自動鍵入關鍵字並提交

public void LauchBr() 
     { 
      string URL = "http://www.alexa.com"; 

      try 
      { 
       System.Diagnostics.Process.Start(URL); 
      } 
      catch 
      (
      System.ComponentModel.Win32Exception noBrowser) 
      { 
       if (noBrowser.ErrorCode == -2147467259) 
        MessageBox.Show(noBrowser.Message); 
      } 
      catch (System.Exception other) 
      { 
       MessageBox.Show(other.Message); 
      } 
     } 
+0

http://www.ichi.co.uk/post/12744611627/getting-an-alexa-rank-programmatically-in-csharp – Zaki

+0

@Sam非常感謝!有效!!! – vyclarks

回答

0

//首先進去的變量

 var inputtextbox = browser.TextField(Find.ByName("CASE")); 
     if (!inputtextbox.Exists) 
     { 
      LogError(c, fileNumber, CommonUtils.Messages.ElementNotFound, ClientID); 
      return; 
     } 

該文本框//你可以使用的TypeText()或價值來輸入你想要的東西。

 inputtextbox.Value = "Your Text here."; 
     inputtextbox.TypeText("Your Text Here"); 
相關問題