Hi, I don't know how to do this, but got something helpful to you on internet. You just need to use this vb program to get the source code of webpage. Just try it.
Code:
Dim URL As String
Dim Host As String
Dim Page As String
Dim lPort As Long
Private Sub GetHTMLSource(ByVal URL As String)
txtSource = ""
Host = Mid(URL, InStr(URL, "://") + 3)
If InStr(Host, "/") > 0 Then
Page = Mid(Host, InStr(Host, "/"))
Host = Left(Host, InStr(Host, "/") - 1)
Else
Page = "/"
End If
If InStr(Host, ":") > 0 Then
lPort = Mid(Host, InStr(Host, ":") + 1)
Host = Left(Host, InStr(Host, ":") - 1)
Else
lPort = 80
End If
With Winsock1
If .State <> sckClosed Then .Close
.RemoteHost = Host
.RemotePort = lPort
.Connect
End With
End Sub
Private Sub cmdGet_Click()
GetHTMLSource txtURL
End Sub
Private Sub Timer1_Timer()
Winsock1.Close
txtSource = "Connection timeout"
End Sub
Private Sub Winsock1_Connect()
Timer1.Enabled = True
Winsock1.SendData "GET " & Page & " HTTP/1.0" & Chr(10) & Chr(10)
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Timer1.Enabled = False
Dim Buffer As String
Winsock1.GetData sBuffer
txtSource = txtSource & Buffer
End Sub
Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, _
ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, _
ByVal HelpContext As Long, CancelDisplay As Boolean)
Winsock1.Close
txtSource = "Error " & Number & ": " & Description
End Sub
Bookmarks