Hello Nitin,

On 9 June 2011 15:10, nitin chandra <nitinchand...@gmail.com> wrote:

> The following is the html code in index.py
>
>         html = "<html><head><title>C Informatics</title></head><body>"
>         html += "<h1><center>Hospital Management & Information
> System</h1><br>"
>         html += '<p><br>'
>         html += '<p><br>'
>         html += '<p><br>'
>         html += '<center>'
>         html += '<form method="post" action="response.py">'
>         html += 'User Name :<input type="text" name="name"><br>'
>         html += 'Password&nbsp&nbsp&nbsp:<input type="password"
> name="paswd1"><br>'
>         html += '<table>'
>         html += '<TR/><TD NOWRAP/>Highest Qualifications:'
>         html += '<TD/><SELECT name="hiqual"/>'
>         html += '<OPTION/>Ph.D / Doctorate'
>         html += '<OPTION/>Post Graduation'
>         html += '<OPTION/>Post Graduation Diploma'
>         html += '<OPTION SELECTED/>Graduation'
>         html += '<OPTION/>Diploma'
>         html += '<OPTION/>Undergraduate'
>         html += '</SELECT/><br>'
>         html += '<input type="submit" Value="Log In">'
>         html += '</form>'
>         html += '</center>'
>         html += "</body></html>"
>
> That's not HTML, that's python code that builds up HTML in a string. (As an
aside, it does that in a rather inefficient way.)

lxml.html is for parsing HTML, it's not meant for parsing "python that
builds HTML".  To belabor the point, lxml.html is meant for proper HTML,
nothing else.  Therefore, you should be feeding a text file (HTML file) into
LXML, not a piece of python code that builds HTML.

Where did you get that HTML?  How did it get to be part of the python code
above?

Walter
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to