Archived Forum Post

Index of archived forum posts

Question:

Why won't Chilkat.Spider (VBScript) access locally served (Apache) pages?

Mar 07 '13 at 15:00

I installed Apache 2.2. I can load local web pages using either 127.0.0.1 or 192.168.1.7 with Firefox. (The web pages I am loading are stored on my hard drive.) When I try to access those addresses with VBScript, it doesn't work. If I access the web with VBScript, it works fine, including if I use an IP address instead of a domain name (i.e. the IP address for Google).

Here's the VBScript that won't work on a locally served file, but will work on an identical file that's on the internet. ("Error" is written to the file if I use 127.0.0.1 or 192.168.1.7) This script writes all the URLs on a webpage to a text file.

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

'  The Chilkat Spider component/library is free.
set spider = CreateObject("Chilkat.Spider")

spider.Initialize "http://192.168.1.7/index.htm"
spider.AddUnspidered "http://192.168.1.7/index.htm"

success = spider.CrawlNext()

if success then

For i = 0 To spider.NumOutboundLinks - 1
    outFile.WriteLine(spider.GetOutboundLink(i))
Next

else
    outFile.WriteLine("Error.")
end if

-

Here are some Apache access logs.

-

Apache's log, running the VBScript (http://192.168.1.7/index.htm)
... GET /robots.txt HTTP/1.1" 404 208
... GET /index.htm HTTP/1.1" 200 365184
... GET /index.htm HTTP/1.1" 200 365184
Apache's log, loading the same from Firefox
... GET /index.htm HTTP/1.1" 200 365184
... GET /index_files/rsAItRhddGWakWTu2xcFYn5VJXiw_002.txt HTTP/1.1" 200 533363
... (additional accesses, with 200 and then different numbers)

Regarding this log, the file saved locally is a Google search results page. (For testing. I won't be using this for Google.) The VBScript will run on the live internet version, but not the copy served locally. Firefox loads the file served locally, and it looks identical to the live one.

My Firewall is turned off. Apache 2.2; Windows XP SP3