set the_HTML to my get_url("http://www.apple.com")
on get_url(this_url)
set browser_string to "'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/125.4 (KHTML, like Gecko) Safari/125.9'"
return do shell script "curl " & (quoted form of this_url) & " -A " & browser_string
end get_url
curl: (7) Failed to connect to [url=http://www.apple.com]www.apple.com[/url] IP number 1: 61
It does this with or without the “the quoted form of” condition. Why is it truncating the address to www.apple.com? I get the same error if I substitute a numerical IP address, so it isn’t that. Error 61 is “Unrecognized transfer encoding”
Ugh. I’m running 10.3.8 as well. My favorite kind of error - unique to my system. I have no idea where to go from here. Could it be because I’m not using Safari as my default browser? (Nope - I tried switching)
Turns out, as I’m sure most readers figured before I did, that this is a problem with my user account. If I run the same code in another account on the same machine it works like a charm. Now to figure out what’s screwing it up in my account!