Re: NSURLConnection and JavaScript
Re: NSURLConnection and JavaScript
- Subject: Re: NSURLConnection and JavaScript
- From: Andrew Farmer <email@hidden>
- Date: Thu, 28 Aug 2008 02:24:19 -0700
On 28 Aug 08, at 01:38, dexter morgan wrote:
I'm using NSURLConnection to download a web page. Unfortunatly some
particular pages detects JavaScript compatibility so the result data
is something like "you cannot see this page because you have not js
enabled".
Is there any way to workaround this "problem"?
Two possibilities:
1. The page you are downloading really does say that (in a <noscript>
tag, perhaps), so you'll need to either run the script or emulate it
to get the content you're looking for.
2. The server is doing user-agent sniffing and sending this message to
clients which have an agent that it doesn't recognize. (This is evil.)
You can construct a NSMutableURLRequest with a custom user-agent
header to counter this.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden