troubleshooting Question

Help to Modify this code so it works for this website

Avatar of bsharath
bsharathFlag for India asked on
ProgrammingVB Script
11 Comments1 Solution489 ViewsLast Modified:
help to
Modify this code so it works for this website

http://mtas.surfcontrol.com/mtas/MTAS.asp

retrieve the category to a column

I will have the website names into the txt file

Script scans each site with "mtas.surfcontrol.com" and lists the category


strInputFile = "input.txt"
strOutputFile = "output.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objHTTP = CreateObject("MSXML2.XMLHTTP")

Set objInput = objFSO.OpenTextFile(strInputFile, 1, False)
Set objOutput = objFSO.CreateTextFile(strOutputFile, True)

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
objIE.Navigate "http://moonsy.com/pagerank_checker/"
While objIE.busy = True Or objIE.ReadyState <> 4
      WScript.Sleep 100
Wend

While Not objInput.AtEndOfStream
      strURL = Trim(objInput.ReadLine)
      If strURL <> "" Then
            objIE.document.form1.domain.value = strURL
            objIE.document.form1.submit.click
            While objIE.busy = True Or objIE.ReadyState <> 4
                  WScript.Sleep 100
            Wend
            strRank = InStr(1, objIE.Document.body.innerText, "your page rank", vbTextCompare)
            If strRank = 0 Then
                  objOutput.WriteLine strURL & ",NOT FOUND"
                  'WScript.Echo strURL & ",NOT FOUND"
            Else
                  strRank = Replace(Trim(Mid(objIE.Document.body.innerText, strRank, 21)), "Your Page Rank:", "")
                  objOutput.WriteLine strURL & "," & strRank
                  'WScript.Echo strURL & "," & strRank
            End If
      End If
Wend
objInput.Close
objOutput.Close

Set objHTTP = Nothing
objIE.Quit
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros