The World's Smallest Web Browser Backstory:


  You enjoy your new programming job at a mega-multi-corporation. However, you aren't allowed to browse the web since your computer only has a CLI. They also run sweeps of all employees' hard drives, so you can't simply download a large CLI web browser. You decide to make a simple textual browser that is as small as possible so you can memorize it and type it into a temporary file every day.


Challenge:

Your task is to create a golfed web browser within a command-line interface. It should:


Take a single URL in via args or stdin
Split the directory and host components of the URL
Send a simple HTTP request to the host to request the said directory
Print the contents of any &lt;p&gt; paragraph &lt;/p&gt; tags
And either exit or ask for another page


More Info:

A simple HTTP request looks like this:

GET {{path}} HTTP/1.1
Host: {{host}}
Connection: close
\n\n


Ending newlines emphasized.

A typical response looks like:

HTTP/1.1 200 OK\n
&lt;some headers separated by newlines&gt;
\n\n
&lt;html&gt;
....rest of page


Rules:


It only needs to work on port 80 (no SSL needed)
You may not use netcat
Whatever programming language is used, only low-level TCP APIs are allowed (except netcat)
You may not use GUI, remember, it's a CLI
You may not use HTML parsers, except builtin ones (BeautifulSoup is not a builtin)
Bonus!! If your program loops back and asks for another URL instead of exiting, -40 chars (as long as you don't use recursion)
No third-party programs. Remember, you can't install anything.
code-golf, so the shortest byte count wins
Pure Bash (no utilities), 200 bytes - 40 bonus = 160
while read u;do
u=${u#*//}
d=${u%%/*}
exec 3&lt;&gt;/dev/tcp/$d/80
echo &quot;GET /${u#*/} HTTP/1.1
host:$d
Connection:close
&quot;&gt;&amp;3
mapfile -tu3 A
a=${A[@]}
a=${a#*&lt;p&gt;}
a=${a%&lt;/p&gt;*}
echo &quot;${a//&lt;\/p&gt;*&lt;p&gt;/&quot;
&quot;}&quot;
done

I think this is up to the spec, though of course watch out for parsing HTML using regex I think the only thing worse than parsing HTML using regex is parsing HTML using shell pattern matching.
This now deals with &lt;p&gt;...&lt;/p&gt; spanning multiple lines.  Each &lt;p&gt;...&lt;/p&gt; is on a separate line of output:
$ echo &quot;http://example.com/&quot; | ./smallbrowse.sh
This domain is established to be used for illustrative examples in documents. You may use this     domain in examples without prior coordination or asking for permission.
&lt;a href=&quot;http://www.iana.org/domains/example&quot;&gt;More information...&lt;/a&gt;
$