The content type for this page is “text/plain” which I think is
part of the problem which might have something to do with it.
A page with a content type of ‘text/plain’ is telling you that the page
is not html. Are you saying that the page is actually html even though
the page says that it does not contain html?
The page is html. Below, I included the log. It shows the page’s
content type to be “text/html” for the first few attempts and then the
last attempt to be “text/plain”. All I need to know is how to get a
page instead of a file either be extending Mechanize, creating a
instance of WWW::Mechanize::Page with the body from the file object or
some other method as I need to get the links.
Any ideas?
Logfile created on Sun Feb 03 18:20:36 -0500 2008 by logger.rb/1.5.2.9
I, [2008-02-03T18:20:36.381042 #15528] INFO – : Net::HTTP::Get:
/menus.htm
D, [2008-02-03T18:20:36.478723 #15528] DEBUG – : request-header:
accept-language => en-us,en;q=0.5
D, [2008-02-03T18:20:36.478919 #15528] DEBUG – : request-header:
connection => keep-alive
D, [2008-02-03T18:20:36.479000 #15528] DEBUG – : request-header: accept
=> /
D, [2008-02-03T18:20:36.479073 #15528] DEBUG – : request-header:
accept-encoding => gzip,identity
D, [2008-02-03T18:20:36.479147 #15528] DEBUG – : request-header:
user-agent => Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.3
D, [2008-02-03T18:20:36.479221 #15528] DEBUG – : request-header:
accept-charset => ISO-8859-1,utf-8;q=0.7,;q=0.7
D, [2008-02-03T18:20:36.479295 #15528] DEBUG – : request-header:
keep-alive => 300
D, [2008-02-03T18:20:36.511382 #15528] DEBUG – : Read 605 bytes
D, [2008-02-03T18:20:36.516205 #15528] DEBUG – : Read 1141 bytes
D, [2008-02-03T18:20:36.516409 #15528] DEBUG – : response-header:
last-modified => Sat, 17 Feb 2007 23:40:30 GMT
D, [2008-02-03T18:20:36.516486 #15528] DEBUG – : response-header:
connection => Keep-Alive
D, [2008-02-03T18:20:36.516559 #15528] DEBUG – : response-header:
content-type => text/html
D, [2008-02-03T18:20:36.516631 #15528] DEBUG – : response-header: etag
=> “4688-475-9e16f780”, “4688-475-9e16f780”
D, [2008-02-03T18:20:36.516702 #15528] DEBUG – : response-header: date
=> Sun, 03 Feb 2008 23:24:11 GMT
D, [2008-02-03T18:20:36.516773 #15528] DEBUG – : response-header:
server => Apache-AdvancedExtranetServer
D, [2008-02-03T18:20:36.516845 #15528] DEBUG – : response-header:
content-length => 1141
D, [2008-02-03T18:20:36.516918 #15528] DEBUG – : response-header:
keep-alive => timeout=15, max=100
D, [2008-02-03T18:20:36.516990 #15528] DEBUG – : response-header:
accept-ranges => bytes, bytes
I, [2008-02-03T18:20:36.517359 #15528] INFO – : status: 200
I, [2008-02-03T18:21:40.578768 #15591] INFO – : Net::HTTP::Get:
/menus.htm
D, [2008-02-03T18:21:40.704310 #15591] DEBUG – : request-header:
accept-language => en-us,en;q=0.5
D, [2008-02-03T18:21:40.704504 #15591] DEBUG – : request-header:
connection => keep-alive
D, [2008-02-03T18:21:40.704582 #15591] DEBUG – : request-header: accept
=> /
D, [2008-02-03T18:21:40.704657 #15591] DEBUG – : request-header:
accept-encoding => gzip,identity
D, [2008-02-03T18:21:40.704732 #15591] DEBUG – : request-header:
user-agent => Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.3
D, [2008-02-03T18:21:40.704806 #15591] DEBUG – : request-header:
accept-charset => ISO-8859-1,utf-8;q=0.7,;q=0.7
D, [2008-02-03T18:21:40.704879 #15591] DEBUG – : request-header:
keep-alive => 300
D, [2008-02-03T18:21:40.740010 #15591] DEBUG – : Read 681 bytes
D, [2008-02-03T18:21:40.740522 #15591] DEBUG – : Read 1141 bytes
D, [2008-02-03T18:21:40.740674 #15591] DEBUG – : response-header:
last-modified => Sat, 17 Feb 2007 23:40:30 GMT
D, [2008-02-03T18:21:40.740755 #15591] DEBUG – : response-header:
connection => Keep-Alive
D, [2008-02-03T18:21:40.740829 #15591] DEBUG – : response-header:
content-type => text/html
D, [2008-02-03T18:21:40.740904 #15591] DEBUG – : response-header: etag
=> “4688-475-9e16f780”, “4688-475-9e16f780”
D, [2008-02-03T18:21:40.740978 #15591] DEBUG – : response-header: date
=> Sun, 03 Feb 2008 23:25:15 GMT
D, [2008-02-03T18:21:40.741053 #15591] DEBUG – : response-header:
server => Apache-AdvancedExtranetServer
D, [2008-02-03T18:21:40.741127 #15591] DEBUG – : response-header:
content-length => 1141
D, [2008-02-03T18:21:40.741200 #15591] DEBUG – : response-header:
keep-alive => timeout=15, max=100
D, [2008-02-03T18:21:40.741273 #15591] DEBUG – : response-header:
accept-ranges => bytes, bytes
I, [2008-02-03T18:21:40.741640 #15591] INFO – : status: 200
I, [2008-02-03T18:21:44.596803 #15596] INFO – : Net::HTTP::Get:
/menus.htm
D, [2008-02-03T18:21:44.664035 #15596] DEBUG – : request-header:
accept-language => en-us,en;q=0.5
D, [2008-02-03T18:21:44.664264 #15596] DEBUG – : request-header:
connection => keep-alive
D, [2008-02-03T18:21:44.664345 #15596] DEBUG – : request-header: accept
=> /
D, [2008-02-03T18:21:44.664417 #15596] DEBUG – : request-header:
accept-encoding => gzip,identity
D, [2008-02-03T18:21:44.664488 #15596] DEBUG – : request-header:
user-agent => Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.3
D, [2008-02-03T18:21:44.664559 #15596] DEBUG – : request-header:
accept-charset => ISO-8859-1,utf-8;q=0.7,;q=0.7
D, [2008-02-03T18:21:44.664630 #15596] DEBUG – : request-header:
keep-alive => 300
D, [2008-02-03T18:21:44.698991 #15596] DEBUG – : Read 605 bytes
D, [2008-02-03T18:21:44.701238 #15596] DEBUG – : Read 1141 bytes
D, [2008-02-03T18:21:44.701421 #15596] DEBUG – : response-header:
last-modified => Sat, 17 Feb 2007 23:40:30 GMT
D, [2008-02-03T18:21:44.701496 #15596] DEBUG – : response-header:
connection => Keep-Alive
D, [2008-02-03T18:21:44.701566 #15596] DEBUG – : response-header:
content-type => text/html
D, [2008-02-03T18:21:44.701638 #15596] DEBUG – : response-header: etag
=> “4688-475-9e16f780”, “4688-475-9e16f780”
D, [2008-02-03T18:21:44.701708 #15596] DEBUG – : response-header: date
=> Sun, 03 Feb 2008 23:25:19 GMT
D, [2008-02-03T18:21:44.701779 #15596] DEBUG – : response-header:
server => Apache-AdvancedExtranetServer
D, [2008-02-03T18:21:44.701848 #15596] DEBUG – : response-header:
content-length => 1141
D, [2008-02-03T18:21:44.701919 #15596] DEBUG – : response-header:
keep-alive => timeout=15, max=100
D, [2008-02-03T18:21:44.702133 #15596] DEBUG – : response-header:
accept-ranges => bytes, bytes
I, [2008-02-03T18:21:44.702519 #15596] INFO – : status: 200
I, [2008-02-03T18:21:46.272708 #15602] INFO – : Net::HTTP::Get:
/menus.htm
D, [2008-02-03T18:21:46.332880 #15602] DEBUG – : request-header:
accept-language => en-us,en;q=0.5
D, [2008-02-03T18:21:46.333074 #15602] DEBUG – : request-header:
connection => keep-alive
D, [2008-02-03T18:21:46.333147 #15602] DEBUG – : request-header: accept
=> /
D, [2008-02-03T18:21:46.333218 #15602] DEBUG – : request-header:
accept-encoding => gzip,identity
D, [2008-02-03T18:21:46.333288 #15602] DEBUG – : request-header:
user-agent => Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/418 (KHTML, like Gecko) Safari/417.9.3
D, [2008-02-03T18:21:46.333360 #15602] DEBUG – : request-header:
accept-charset => ISO-8859-1,utf-8;q=0.7,;q=0.7
D, [2008-02-03T18:21:46.333431 #15602] DEBUG – : request-header:
keep-alive => 300
D, [2008-02-03T18:21:46.361484 #15602] DEBUG – : Read 0 bytes
D, [2008-02-03T18:21:46.362406 #15602] DEBUG – : Read 948 bytes
D, [2008-02-03T18:21:46.365163 #15602] DEBUG – : Read 1141 bytes
D, [2008-02-03T18:21:46.365336 #15602] DEBUG – : response-header:
last-modified => Sat, 17 Feb 2007 23:40:30 GMT
D, [2008-02-03T18:21:46.365410 #15602] DEBUG – : response-header:
connection => Keep-Alive
D, [2008-02-03T18:21:46.365481 #15602] DEBUG – : response-header:
content-type => text/plain
D, [2008-02-03T18:21:46.368645 #15602] DEBUG – : response-header: etag
=> “4688-475-9e16f780”
D, [2008-02-03T18:21:46.368781 #15602] DEBUG – : response-header: date
=> Sun, 03 Feb 2008 23:25:21 GMT
D, [2008-02-03T18:21:46.368855 #15602] DEBUG – : response-header:
server => Apache-AdvancedExtranetServer
D, [2008-02-03T18:21:46.368927 #15602] DEBUG – : response-header:
content-length => 1141
D, [2008-02-03T18:21:46.368998 #15602] DEBUG – : response-header:
keep-alive => timeout=15, max=100
D, [2008-02-03T18:21:46.369070 #15602] DEBUG – : response-header: age
=> 1
D, [2008-02-03T18:21:46.369141 #15602] DEBUG – : response-header:
accept-ranges => bytes
I, [2008-02-03T18:21:46.369512 #15602] INFO – : status: 200