(view source code of nswhois.vbs as plain text)
Option ExplicitWScript.Echo NetSolWhoIs( "google.com", 10 )
Function NetSolWhoIs( myDomain, myTimeOut )
' This function uses Network Solutions, Inc.'s WhoIs page to' retrieve information for .com, .org, and .net (and other)' domains.' Note that this function will break as soon as Network' Solution alters the layout of the WhoIs results page.'' Arguments:' myDomain [string] domain name to be queried,' e.g. "google.com"' myTimeOut [integer] time-out in seconds'' Returns:' Formated WhoIs information (multi-line string)'' Written by Rob van der Woude' http://www.robvanderwoude.com Dim arrLine, arrText, blnTimedOut, i, objIE ' Open the appropriate NetSol WhoIs URL in Internet ExplorerSet objIE = CreateObject( "InternetExplorer.Application" )
objIE.Visible = False
objIE.Navigate2 "https://www.networksolutions.com/whois/" _
& "registry-data.jsp?domain=" & Trim( myDomain )
' Wait till IE is readyi = 0
blnTimedOut = False
Do While objIE.Busy
WScript.Sleep 100
i = i + 1
' Time out after the specified number of secondsIf i > CInt( myTimeOut * 10 ) Then
blnTimedOut = True
Exit Do
End If
Loop ' Retrieve the URL's text and save it in an arrayIf Not blnTimedOut Then
arrText = Split( objIE.Document.Body.InnerText, vbLf )
End If
' Close the Internet Explorer sessionobjIE.Quit
Set objIE = Nothing
' Check if a time-out occurred, and return the resultIf blnTimedOut Then
NetSolWhoIs = "-- timed out --"
Else ' Filter out the lines starting with 3 spacesFor i = 0 To UBound( arrText )
If Left( arrText(i), 3 ) = " " Then
arrLine = Split( arrText(i), ":" )
' Add the line to the function's return value NetSolWhoIs = NetSolWhoIs _& Left( Trim( arrLine(0) ) _
& String( 20, " " ), 20 ) _
& arrLine(1) & vbCrLf
End If
NextEnd If
End Function
page last modified: 2025-10-11; loaded in 0.0081 seconds