Results 1 to 9 of 9

Thread: [RESOLVED] Get HTML source code of page(WinSck)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Location
    Iran
    Posts
    237

    Resolved [RESOLVED] Get HTML source code of page(WinSck)

    Hi,
    How can i get HTML source code of page(Using WinSck)?
    Ex. page: https://edit.my.yahoo.com/registration?
    Very thanks .
    Y.P.Y

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Get HTML source code of page(WinSck)

    Are you using VB6?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Location
    Iran
    Posts
    237

    Re: Get HTML source code of page(WinSck)

    Yes, VB 6.0
    Y.P.Y

  4. #4
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Get HTML source code of page(WinSck)

    Your first problem is you are trying to use Winsock to connect to a secure server, hense the https. I don't think you are going to get very far with this way. You would be better off using the Inet control or the WebBrowser control since they will take care of the security stuff for you and Winsock will not.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Location
    Iran
    Posts
    237

    Re: Get HTML source code of page(WinSck)

    I do this, thanks both :

    WinSck_General.Connect "edit.cn.yahoo.com", 80

    Private Sub WinSck_General_Connect()
    On Error Resume Next
    Dim_Str_HTTPRequest = "Get /config/eval_register?" & " HTTP/1.0" & vbCrLf
    Dim_Str_HTTPRequest = Dim_Str_HTTPRequest & "Host: " & WinSck_General.RemoteHost & vbCrLf
    Dim_Str_HTTPRequest = Dim_Str_HTTPRequest & "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    Dim_Str_HTTPRequest = Dim_Str_HTTPRequest & "Connection: Keep-Alive" & vbCrLf
    Dim_Str_HTTPRequest = Dim_Str_HTTPRequest & vbCrLf
    Fra_StartOrCreate_TxtBx_Status.Text = "Status: Requesting data(Get)..."
    WinSck_General.SendData (Dim_Str_HTTPRequest)
    End Sub
    Y.P.Y

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Get HTML source code of page(WinSck)

    Well whatever data you will get from that request will come into your DataArrival event.

  7. #7
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Get HTML source code of page(WinSck)

    If you want you can do it using this code and the usage is...

    Code:
    Private Sub Command1_Click()
    CopyURLToFile "http://www.google.com", "C:\blah.txt"
    End Sub
    Or you can even use the WebBrowser control for this. But if your are persistent on using the Winsock Control then what ever you recieve back after sending your GET request will be done through the DataArrival method as mentioned above.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Location
    Iran
    Posts
    237

    Re: Get HTML source code of page(WinSck)

    I think "WinSck" is very fastest.
    Y.P.Y

  9. #9
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Get HTML source code of page(WinSck)

    The API in the example use winsock some where down the line i believe.

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