2015-05-23 27 views
-1

訪問網站: https://satoshimines.com/如何在webbrowser中單擊一個JavaScript按鈕,以便在網頁源代碼中不顯示該代碼?

點擊播放,將0下注,然後點擊播放


現在,這裏就是我覺得有趣,如果你查看頁面的源代碼有沒有所顯示的代碼遊戲委員會。我認爲其中的一個JavaScript是棋盤遊戲。在檢查元素,你可以看到棋盤遊戲 http://prntscr.com/78ge73

這樣的元素,我的問題是有可能點擊遊戲牌之一,如果該網站是在VB裏面一個網頁瀏覽器加載?如果是這樣,請指向正確的方向。

下面是我試圖點擊它的方法。 (不起作用)

Private Sub Clicktile() 
    TextBox2.Text = TextBox2.Text + "Trying to click Tile..." + Environment.NewLine 
    'Try statement so if it dicks up the program won't crash 
    Try 
     'Declares in Memory the page source as a HtmlElementCollection 
     Dim ae As HtmlElementCollection = WebBrowser1.Document.All 
     'Declares in Memory each Element within the page source 
     For Each wpe As HtmlElement In ae 

      If wpe.GetAttribute("data-tile") = "1" Then 
       wpe.InvokeMember("click") 
      Else 
       TextBox2.Text = TextBox2.Text + "Error on ClickTile1" + Environment.NewLine 
      End If 

     Next 
    Catch ex As Exception 
     TextBox2.Text = TextBox2.Text + "Catch ex As Exception called" + Environment.NewLine 
    End Try 
End Sub 

回答

1

啊啊!你試圖欺騙! (或嘗試垃圾郵件)

當您點擊圖塊時,網頁發送XMLHTTPRequest以獲取答案狀態。因此,在點擊按鈕之前,您無法看到按鈕下的內容!

+0

我正試圖讓一個機器人爲我玩遊戲。^_ ^感謝您的信息! – user3890485

相關問題