Hi
I want to read a source code of a web page & then write it into a text file using vbscript. I have used this code but not working properly.
Error : ActiveX component can't create the object
Option Explicit
Dim objHttp
Dim strUrl
Dim strData
' Create a HTTP instance
Set objHttp = CreateObject("ActiveXperts.Http")
' Write some information to console
WScript.Echo "ActiveSocket " & objHttp.Version & " demo."
WScript.Echo "Expiration date: " & objHttp.ExpirationDate & vbCrLf
Do
strUrl = inputbox( "Enter a URL", "Input", "www.activexperts.com/products" )
Loop until strUrl <> ""
objHttp.LogFile = "C:\HttpLog.txt"
objHttp.Connect( strUrl )
If( objHttp.LastError <> 0 ) Then
WScript.Echo "Error " & objHttp.LastError & ": " & objHttp.GetErrorDescription( objHttp.LastError )
Else
strData = objHttp.ReadData
If( objHttp.LastError <> 0 ) Then
WScript.Echo "Error " & objHttp.LastError & ": " & objHttp.GetErrorDescription( objHttp.LastError )
Else
WScript.Echo strData
End If
objHttp.Disconnect
WScript.Echo "Disconnect."
End If
WScript.Echo "Ready."