top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Generating HTML in python?

0 votes

In Perl I had been using HTML::Element with great success, and now I would like to know if something similar exists for Python?

I would like to construct the complete page as a plain python structure and then feed it to a function to get a chunk of HTML ready to send to the client.

Something like:

table_struct = [table, [tr, [td, {class=>"red"}, "this is red"],[td, {class=>"blue"}, "this is not red"]]]   
html = struct2html(table_struct)
posted Jul 29, 2013 by Sheetal Chauhan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
answer Jul 29, 2013 by Mandeep Sehgal
Similar Questions
0 votes

I was looking for a good tutorial for a "HTML Parser". My intention was to extract tables from web pages or information from tables in web pages.

I tried to make a search, I got HTMLParser, BeautifulSoup, etc. HTMLParser works fine for me, but I am looking for a good tutorial to learn it nicely.

I could not use BeautifulSoup as I did not find an .exe file.

I am using Python 2.7 on Windows 7 SP1 (64 bit).

I am looking for a good tutorial for HTMLParser or any similar parser which have an .exe file for my environment and a good tutorial.

+1 vote

i want to create a chrome extension. its have complex mathematical queries. so i need to use python as scripting language. help me to implement python script in google chrome addon

–1 vote

I'm working on a new project and i want to receive a request from a user and to redirect him to a third party site, but on the page after i redirect my users i want to them to see injected html (on the third party site.)

i'm not really sure how to approach this problem..