Sure you can do this quite easily.

Basically all you need to do is spoof a web browser. If you look at the RFC for the http 1.1 protocol you can read all about it ftp://ftp.isi.edu/in-notes/rfc2616.txt

The following is how I used telnet to get get the HTML code for the opening page of google.com.

NOTE: For any HTML over SSL you would have to do some extra work... For my example ">" denotes what is returned to me by the server. Everything else I typed in.

$telnet google.com 80 >Trying 64.233.187.99... >Connected to google.com. >Escape character is '^]'. GET http://www.google.com/ HTTP/1.1 >HTTP/1.1 200 OK >Cache-Control: private >Content-Type: text/html; charset=ISO-8859-1 >Server: GWS/2.1 >Transfer-Encoding: chunked >Date: Wed, 06 Jun 2007 21:01:48 GMT >Set-Cookie: >PREF=ID=b52be41e5ad2eb1b:TM=1181163708:LM=1181163708:S=Y +1L>Lo7leE_1XL >0KD; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; >domain=.google.c +om >Connection: Keep-Alive ... #Here is the dump of the HTML that I don't want to paste.

In reply to Re: preview HTML without a browser? by Grundle
in thread preview HTML without a browser? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.