urllib - Parsing Python Response using httplib -


After connecting to the socket and using the response .read () how I parse the input stream and read the lines Can i

I think the data is any CRLF

   gt; And & gt; Title & gt; Title & gt; ApacheTamac / 6.0.16 - Error Report & lt; / Title & gt; & Lt; Style & gt; & Lt ;! - H1 {font-family: temohoma, aerial, non-serif; color white; Background color: # 525D76; Font-size: 22px;} H2 {font-family: Tahoma, aerial, sans-serif, color: white; Background color: # 525D76; Font-size: 16px;} H3 {font-family: Tahoma, Ariel, non-serif; color white; Background color: # 525D76; Font-size: 14px;} body {font-family: Tahoma, Ariel, Sans-Serif; color black; Background-color: white;} b [font-family: Tahoma, aerial, non-serif, color: white; Background-color: # 525D76;} p {font-family: temohoma, ariel, non-serif; Background: white; color black; Font-size: 12px;} a {color: black;} anonymous {color: black; } Hr {color: # 525D76;} - & gt; & Lt; / Style & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; HTTP Status 404 - /index.html</h1><HR Size = "1" Nourished = "Novode" & gt; & Lt; P & gt; & Lt; B & gt; Type & lt; / P & gt; Status report & lt; / P & gt; & Lt; P & gt; & Lt; B & gt; Message & lt; / B & gt; & Lt; U & gt; /index.html< / U & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; P & gt; Description & lt; / P & gt; & Lt; U & gt; The requested resource (/index.html) is not available. & Lt; / U & gt; & Lt; / P & gt; & Lt; HR size = "1" noshade = "noshade" & gt; & Lt; H3 & gt; Apache Tomack / 6.0.2 & lt; / H3 & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

You have to parse the HTML. Python has several ways of parsing HTML - one of them is the underlying module, another, and possibly better method, is the third party module.

Many other issues dealing with HTML processing are explained in this. You can also read dip in the Python book (Free Online).


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -