QuestionHelp with any code

Posts 1–12 of 12 · Page 1 of 1
Help with any code
Hello, i'm making any bot. So, i have some problem with label
Code:
 Friend WithEvents Browser As System.Windows.Forms.WebBrowser

Browser.Document.GetElementById("skip_button").InvokeMember("click")
When debugging program *exe stopped and VS show line with WebBrowserone.Document.GetElementById("skip_button ").InvokeMember("click").

May be somebody can help me solve this problem?

P.s On inspector in browser button have id = "skip_button", and event click.

Sorry for my bad lang
Quote Originally Posted by Ac1d777 View Post
Hello, i'm making any bot. So, i have some problem with label
Code:
 Friend WithEvents Browser As System.Windows.Forms.WebBrowser

Browser.Document.GetElementById("skip_button").InvokeMember("click")
When debugging program *exe stopped and VS show line with WebBrowserone.Document.GetElementById("skip_button ").InvokeMember("click").

May be somebody can help me solve this problem?

P.s On inspector in browser button have id = "skip_button", and event click.

Sorry for my bad lang
Yes, because you must put before the link where you want to click - try this:

Code:
    Friend WithEvents Browser As New WebBrowser

Browser.Navigate("the website where you want to navigate")
Browser.Document.GetElementById("skip_button").InvokeMember("click")
and if you want to get the result, in a button insert a WebBrowser in your project and write this code:
Code:
WebBrowser1.DocumentText = Browser.DocumentText
Quote Originally Posted by Raydenman View Post
Yes, because you must put before the link where you want to click - try this:

Code:
    Friend WithEvents Browser As New WebBrowser

Browser.Navigate("the website where you want to navigate")
Browser.Document.GetElementById("skip_button").InvokeMember("click")
and if you want to get the result, in a button insert a WebBrowser in your project and write this code:
Code:
WebBrowser1.DocumentText = Browser.DocumentText
Thank you, but don't work with this
@OP You only need 1 webbrowser ... (right?)

1) Did you drag-and-drop a webbrowser control onto your form (it would get the default name WebBrowser1)
OR
2) Did you create the browser in code only


If 1, then why are you declaring another WebBrowser variable named "Browser" ?
If 2, you need to use the NEW keyword (Raydenman did this correctly) ....you're only declaring a reference to a browser object, not actually instantiating a new object.

Post more of the code? Like the guy above said, it seems like you don't actually load any page, so .GetItemById() is bound to fail..
Also post the exact error message...help us help you.
Well, i have 2 projects, First - autoklicker(without webbrowser in gui) Second - manually(webbrowser in gui). Manualy working fine.. I using proxy, and a i think i find problem. So (Autoklick method) after page load we do -->
Code:
Browser.Document.GetElementById("skip_button").InvokeMember("click")
, right! But whats happened if proxy server is die? Right --> bot is crash, because page not load else no connection, no skip_button and nothing to klick... I think try method with progress bar. if progress bar(connection) = 100% then
Code:
Browser.Document.GetElementById("skip_button").InvokeMember("click")
else: wait 30 sec and go to next proxy server. Any ideas?

And add if skip_button don't found --> go next proxy
You can try to add a routine Function to check the proxy if it isn't working, that for example it will return a boolean value, example:
Code:
    Function chkProxy(ByVal prxy As String) As Boolean
        Dim x As New WebClient
        Try
            x.Proxy = New WebProxy(prxy)
            x.OpenRead("http://google.it/")
            Return True
        Catch
            Return False
        End Try
    End Function
example;
Code:
        Dim proxy As String = InputBox("Proxy2Check", "inputBox")
        If chkProxy(proxy) Then
            MsgBox("Proxy working", MsgBoxStyle.Information, "Information")
        End If
Quote Originally Posted by Raydenman View Post
You can try to add a routine Function to check the proxy if it isn't working, that for example it will return a boolean value, example:
Code:
    Function chkProxy(ByVal prxy As String) As Boolean
        Dim x As New WebClient
        Try
            x.Proxy = New WebProxy(prxy)
            x.OpenRead("http://google.it/")
            Return True
        Catch
            Return False
        End Try
    End Function
example;
Code:
        Dim proxy As String = InputBox("Proxy2Check", "inputBox")
        If chkProxy(proxy) Then
            MsgBox("Proxy working", MsgBoxStyle.Information, "Information")
        End If
That's can't help, because if proxy alive, have connection all ok, can may be that
If in autoklick will something as in pic, than crash, because no skip_button and nothing to klick...
PM2help, see the PM
If you do not understand, never mind ... buy a book to study VB.NET language
Mm, good, i look it, thanks
Quote Originally Posted by Raydenman View Post
@Ac1d777 have you resolved?
No, working...
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?