2016-09-20 11 views
-1

ウェブサイトのテキストボックスにテキストを挿入したいのですが、できません。 最初の入力は成功しましたが、エラー:テキストボックスにテキストを追加するには?

"An error has occurred in the script on this page, object doesn't support property or method 'addEventListener'" ; "JSON" is undefined and another more..,と別の1つのパラメータで、同じことをしたい場合はできません。

どうすれば解決できますか?

編集:コンソールでは示しています

感謝を「ベクトルスマッシュ保護が有効になっています」!

コード:

WebBrowser wb; 
     public BrowserWindow() 
     { 

      int i = 0; 
      Load += delegate 
       { 
        this.wb = new WebBrowser(); 
        this.wb.Dock = DockStyle.Fill; 
        this.Controls.Add(this.wb); 
        this.wb.Visible = true; 
        this.wb.Navigate("http://www.zzz.com/"); 
        this.wb.DocumentCompleted += delegate 
        { 
         if (i == 0) 
         { 
          HtmlElement x = wb.Document.GetElementById("a"); 
          x.InnerText = "b"; 
         } 
         if (i == 1) 
         { 
          HtmlElement y = wb.Document.GetElementById("c"); 
          y.InnerText = "d"; 
         } 
        }; 


       }; 
     } 

答えて

0

使用SetAttributeののHtmlElement

wb.Document.GetElementById("a").SetAttribute("value", "bla bla bla"); 
+0

に私が入れている:wb.Document.GetElementById( "A")のSetAttribute( "値"、 "b" を)。 ; 私は同じ結果を持っています コンソールで「ベクトルスマッシュ保護が有効になっています」というメッセージが表示されたので、私は質問を編集しました – TomaateTip

+0

@TomaateTip実際のページURLを教えてください。 – SBrassard

+0

URLはwww.lufthansa.com – TomaateTip

関連する問題