Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: titan0060 on October 16, 2004, 08:45 PM

Title: HTML GetStuff?
Post by: titan0060 on October 16, 2004, 08:45 PM
Ok, the GetStuff command basicaly searches a text file, but is there any way i can have it search an INTERNET PAGE?  the page is like plain HTML, no flash or anything.
Title: Re: HTML GetStuff?
Post by: Warrior on October 16, 2004, 09:09 PM
You mean display the HTML? If you mean using a .html file for config.....wtf?
Title: Re: HTML GetStuff?
Post by: titan0060 on October 16, 2004, 09:16 PM
i mean search my webbrowser (which is already on the site i want in frmBrowser) and look for a sertain string like "Yo"... Then display like in a msgbox,  what the next thing that comes after the word "Yo"...

Basicaly if i could convert the webbrowser into a string, i can just use the splt() command... but how do u convert it to a string.
Title: Re: HTML GetStuff?
Post by: Newby on October 16, 2004, 09:18 PM
The "GetStuff" function, if you are using the common one found in most open-source Visual Basic bots, utilizes API calls that don't access the internet.

You would have to re-code it using some sort of internet control, that would connect to the file, input its contents, and search through that.
Title: Re: HTML GetStuff?
Post by: titan0060 on October 16, 2004, 09:34 PM
i never expected to use the exact getstuff code... i just want sumthing to search my WebBrowser1 for a sertain word...
Title: Re: HTML GetStuff?
Post by: ______ on October 17, 2004, 12:06 AM
Quote from: titan0060 on October 16, 2004, 09:34 PM
i never expected to use the exact getstuff code... i just want sumthing to search my WebBrowser1 for a sertain word...

You mean something like this?

If InStr(WebBrowserText, myword) = 0 Then
MsgBox "Not found."
Else
MsgBox "Found!"
End If
Title: Re: HTML GetStuff?
Post by: CrAz3D on October 17, 2004, 12:53 AM
Look @ the webpage's source through the webbrowser control.  YAY, that is how I got my lovely gmail acct.
Title: Re: HTML GetStuff?
Post by: Newby on October 17, 2004, 12:55 AM
Quote from: CrAz3D on October 17, 2004, 12:53 AM
Look @ the webpage's source through the webbrowser control.  YAY, that is how I got my lovely gmail acct.
Idea stealer!
Title: Re: HTML GetStuff?
Post by: LivedKrad on October 17, 2004, 12:30 PM
What about GMail??
Title: Re: HTML GetStuff?
Post by: titan0060 on October 17, 2004, 04:04 PM
Quote from: CrAz3D on October 17, 2004, 12:53 AM
Look @ the webpage's source through the webbrowser control.  YAY, that is how I got my lovely gmail acct.

how do i get my program to open the page source...
Title: Re: HTML GetStuff?
Post by: CrAz3D on October 17, 2004, 06:34 PM
Quote from: titan0060 on October 17, 2004, 04:04 PM
Quote from: CrAz3D on October 17, 2004, 12:53 AM
Look @ the webpage's source through the webbrowser control.  YAY, that is how I got my lovely gmail acct.

how do i get my program to open the page source...
Don't remember, check pscode. (it pwns my mom)
Title: Re: HTML GetStuff?
Post by: Dyndrilliac on October 17, 2004, 06:42 PM
Use OpenURL on the inet control and give the value to a string variable.
Title: Re: HTML GetStuff?
Post by: Imperceptus on October 20, 2004, 08:34 PM
How I do it
Your Inet Control  = MyInetControl

*note untested code


Private Sub Form_Load()
MyInetControl.execute("http://yoni.valhallalegends.com")

End Sub


Private Sub MyInetControl_StateChanged(ByVal State As Integer)
    Dim vtData As Variant
    Dim StrData As String
    Dim bDone As Boolean: bDone = False

With MyInetControl
    Select Case State       
        Case icError        ' 11   ' In case of error, return ResponseCode and
                                            ' ResponseInfo.
           vtData = .ResponseCode & ":" & .ResponseInfo
           vtData = .ResponseCode & ":" & .ResponseInfo
           itProcessCount = itProcessCount - 1
       Case icResponseCompleted     ' 12 good Retrieve server response
                                                        '  using the GetChunk
            vtData = .GetChunk(1024, icString) ' Get first chunk.
            Do While Not bDone
               StrData = StrData & vtData
               vtData = .GetChunk(331000, icString) ' Get next chunk.
               DoEvents
               If Len(vtData) = 0 Then bDone = True
            Loop
           
        Case Else
    End Select
End Sub



Hope this provides some ideas, not you might want to change the GetChunk Sizes around I just mashed some numbers on the numpad.  Execute is hands down way faster then OpenUrl.
Title: Re: HTML GetStuff?
Post by: YaYYo on October 24, 2004, 04:27 AM
Quote from: Imperceptus on October 20, 2004, 08:34 PM
How I do it
Your Inet Control  = MyInetControl

*note untested code


Private Sub Form_Load()
MyInetControl.execute("http://yoni.valhallalegends.com")

End Sub
[/quote]

Shouldnt it be My.InetControl.Execute("http://yoni.valhallalegends.com")

?
Title: Re: HTML GetStuff?
Post by: Dyndrilliac on October 24, 2004, 10:04 AM
No, MyInetControl is the controls name.