From: Marcin Raczkowski Date: 2008-02-04T09:48:26+09:00 Subject: Re: mechanize get methods returns both ::File and ::Page 7stud -- wrote: > Marcin Raczkowski wrote: >>> Since Mechanize is used to parse forms and html, that makes sense: if >>> you don't have an html page(i.e. one with a Content-Type = text/*html*), >>> then you can't parse it as html. >> yes you can - use plugable parasers >> > > Explain how you would parse plain text such as: > > Hi, > > My name is Sally. > > Yours Truly, > Sally > > as html?? What's the ? Which part is a <form>? Did mama hit you in a head when you were young? Do you know what are MIME encodings? Servers are requred by http specification to provide mime-encoding - and content should be interpreted acording to it - if it's text/plain it should be just displayed if it's application/zip then saved etc. BUT since most servers don't implement it fully - or have to be configured - or php cgi script (or ruby for that matter) might alter it - and sometimes does - html can be served with mime-type text/plain since mechanized follows that standard - it assumes that data with mime text/plain is in fact plain text just like one you provided - but what if it's website (which Carl clearly explained in initial post) - then you have to force it to treat it as html - clear enough?