|
-
Jan 17th, 2008, 04:36 PM
#1
Thread Starter
Addicted Member
[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 .
-
Jan 17th, 2008, 05:48 PM
#2
Re: Get HTML source code of page(WinSck)
-
Jan 18th, 2008, 10:01 AM
#3
Thread Starter
Addicted Member
Re: Get HTML source code of page(WinSck)
-
Jan 19th, 2008, 12:15 PM
#4
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.
-
Jan 20th, 2008, 04:05 AM
#5
Thread Starter
Addicted Member
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
-
Jan 20th, 2008, 12:50 PM
#6
Re: Get HTML source code of page(WinSck)
Well whatever data you will get from that request will come into your DataArrival event.
-
Jan 21st, 2008, 12:34 AM
#7
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.
-
Jan 21st, 2008, 03:09 AM
#8
Thread Starter
Addicted Member
Re: Get HTML source code of page(WinSck)
I think "WinSck" is very fastest.
-
Jan 21st, 2008, 04:22 AM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|