I’m starting to see how incredibly awesome curl commands are (thanks Stefan!) and I saw someone mentioned in an older post that w/ the curl command you can generally access anything your browser can, but occassionaly there’s some creative workarounds required for certain pages.
Well, I’m in need of a workaround for my new script.
set phoneNum to "408-886-9012"
set whitePage to "http://www.411.com/search/ReversePhone?phone="
set theDate to do shell script "curl " & whitePage & phoneNum
set theFile to (":Users:MYUSERNAME:Documents:" & "whitepage_" & phoneNum & ".txt")
try
set ff to open for access theFile with write permission
write theDate to ff starting at 0
close access ff
on error
try
close access theFile
end try
end try
tell application "TextEdit"
open (":Users:MYUSERNAME:Documents:" & "whitepage_" & phoneNum & ".txt")
end tell
This script returns some html code, but not the entire webpage, and I see this mentioned in the code:
Forbidden you don’t have permission to access this server
Any suggestions on a workaround to this?