Results 1 to 6 of 6

Thread: Load HTML source in Text box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    92

    Load HTML source in Text box

    I am trying to put my HTML in a text box so i can extract the data from it. I can print it to the form but not to the text box. What is the best way to do this?
    Also how do I parse it out once it is in the text box. The information will be printed to a file to be used in Exel. I will need to search for the information between "text4" and exclude the tags.

    Thanks for any help.

    Here is the code i am using.

    Dim myurl As String

    Private Sub cmdret_Click()

    myurl = txturl.Text
    WebBrowser1.Navigate2 (myurl)
    Inet1.Protocol = icHTTP
    Inet1.Execute CStr(txturl), "GET /"

    While Inet1.StillExecuting
    DoEvents
    Wend
    MsgBox "Done"
    End Sub

    Private Sub Inet1_StateChanged(ByVal State As Integer)
    Select Case State
    Case 12
    stemp = Inet1.GetChunk(100)
    While stemp <> ""
    Form1.Print stemp;
    stemp = Inet1.GetChunk(100)
    Wend
    Form1.Print
    Case 11
    MsgBox Inet1.ResponseInfo, vbCritical, "error"
    End Select
    End Sub

    Private Sub txturl_Change()
    myurl = txturl.Text
    End Sub

  2. #2
    Lively Member Bootking's Avatar
    Join Date
    Mar 2003
    Location
    Marquette University
    Posts
    90
    Hey Everybody!

    I was wondering about this problem too. Does anybody know how to download a file by its URL? Is it possible perhaps to use the IE object to navigate to the page you want and then find the file in your Temporary Internet Files folder? If anybody finds out how to do this, I'd appreciate it a lot. In the mean time, i will take a look at it myself.
    Check out my band's website!
    Walter Walker Band

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    92
    The code listed gets the HTML but I need to put it in a text box , not the form. How do i do this?

  4. #4
    Junior Member
    Join Date
    May 2003
    Posts
    28
    Originally posted by tarctor
    The code listed gets the HTML but I need to put it in a text box , not the form. How do i do this?
    How about
    Code:
    Text1.Text = Text1.Text & stemp
    instead of
    Code:
    Form1.Print stemp;
    ?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2003
    Posts
    92

    This works

    Hi that works for getting it into a text box , now i have another problem. My code for some reason doesnt get all the HTML. should it pause to wait on the internet to load completly ? if so how do i do this?

  6. #6
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    india
    Posts
    418
    hi,

    for this problem use richtextbox control it is easy get html data and also print the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width