fetch returns nothing

cpm18
Posts: 39
Joined: Mon Apr 13, 2009 3:21 pm

fetch returns nothing

Post by cpm18 »

I am trying to fetch the html of a page but for some reason I get back an empty value in $ret. The page url is http://forum.gamer.com.tw/

<fetch $cgipath>
<$htmlpage=$ret>
<urlinfo errmsg>
$ret
-9- $htmlpage -9-


In the brief example I post above, I get a message of 'Ok' for my error message and the value of $htmlpage is nothing.

I don't recall every seeing this as usually I will get the html for the given page. Is there any other ways I should be looking at diagnosing this problem?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

fetch returns nothing

Post by mark »

Not sure. A quick test with my browser's view source also shows nothing. And fetching the page with other tools also gets empty results.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

fetch returns nothing

Post by Kai »

That site apparently does not have an uncompressed (identity) response for that page, which would be the only encoding valid for the HTTP/1.0 request made by <fetch>; thus it returns empty. (However it should probably return 406 Unacceptable instead, to indicate lack of an uncompressed response, instead of 200 Ok with no content; hence the confusion since there is no error.)

If your Vortex release is 20090801 or later, you can set <urlcp httpversion 1.1> and try the fetch; this will enable some HTTP/1.1 features, including content/transfer encodings which will enable a gzip-encoded reply to be sent (and automatically decompressed by <fetch>).
cpm18
Posts: 39
Joined: Mon Apr 13, 2009 3:21 pm

fetch returns nothing

Post by cpm18 »

This might not be related but I'm again having trouble fetching pages. For url http://www.pocketpc.com.hk/forum.php, I can view the page fine and get the source html with my browser. But upon fetching, I am getting an output of...

½ШϥÎInternet ExplorerÂsÄý¾¹¡A¦ӥBª©¥»5.5©ΥH¤W¨ÓÂsÄý¥»¯¸

I upgraded to release 20091117 and used the http1.1 setting recommended above and that solved the problem for the previous site. But for this site, something else seems to be occuring which is creating the unexpected output.

Any ideas as to why I am unable to get the page html?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

fetch returns nothing

Post by mark »

I get the same thing when attempting to view the site with firefox. Apparently it's doing browser detection and rejecting anything but IE. You can try setting the user agent to something IE. Maybe something like
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)