473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

HTML Table-of-Content Extraction Script

I'm looking for a function which extracts a table of contents of HTML file(s) from <Hx....><a name=...></a>...</Hxand possibly auto-creates the ancors.
Maybe something already exists?
Robert
Nov 28 '06 #1
3 2285
robert wrote:
I'm looking for a function which extracts a table of contents of HTML file(s) from <Hx....><a name=...></a>...</Hxand possibly auto-creates the ancors.
Maybe something already exists?
You can try mine:
http://www.thomas-guettler.de/script...eadings.py.txt

--
Thomas Güttler, http://www.thomas-guettler.de/ http://www.tbz-pariv.de/
E-Mail: guettli (*) thomas-guettler + de
Spam Catcher: ni**************@thomas-guettler.de

Nov 28 '06 #2
robert wrote:
I'm looking for a function which extracts a table of contents
of HTML file(s) from <Hx....><a name=...></a>...</Hx>
and possibly auto-creates the ancors.
Maybe something already exists?
that's the kind of stuff you'll write in approximately two minutes using
BeautifulSoup (or if you prefer the ElementTree API, ElementSoup).

start here:

http://www.crummy.com/software/BeautifulSoup/

</F>

Nov 28 '06 #3

Fredrik Lundh wrote:
robert wrote:
I'm looking for a function which extracts a table of contents
of HTML file(s) from <Hx....><a name=...></a>...</Hx>
and possibly auto-creates the ancors.
Maybe something already exists?

that's the kind of stuff you'll write in approximately two minutes using
BeautifulSoup (or if you prefer the ElementTree API, ElementSoup).

start here:

http://www.crummy.com/software/BeautifulSoup/

</F>
splity does that, but it's not Python.

Cheers,
-T

Nov 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Philippe C. Martin | last post by:
Hi, I wish to use an easy way to generate reports from wxPython and feel wxHtmlEasyPrinting could be a good solution. I now need to generate the HTML wxHtmlEasyPrinting can print: I need to...
2
by: Dr. Who | last post by:
I have a tool that outputs data in either html or text output. Currently I'm writing chucnks like: if html: print '<html><body bgcolor="FFFFCC">' print '<table border="1" bgcolor="CCCCFF"...
9
by: Domestos | last post by:
Here an unusual one... Say i am writing a few lines of code in php script as so... <?php echo '<table>'; echo '<tr>'; echo '<td> blah blah </td>'; echo '</tr>'; echo '</table>';
3
by: Al Wilkerson | last post by:
Hey, I have a Web Form with a drop down list, textbox, and search button. When click the search button an SQL server database is queried fordata. Once I have the data in a dataset I use the...
2
by: simon | last post by:
I have simple question: The red table should be the same height as the blue one because it has set the height to 100% but it's not. How can I solve that problem? <html> <head> </head>...
1
by: Kevin | last post by:
How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how? Basically if the file exists, it should display the page that will include mb.html. ...
6
by: Rolf Welskes | last post by:
Hello, if I have for example: <table style="width: 100%; height: 100%;" border="1"> <tr> <td style="width: 100px">k </td> <td style="width: 100px">k </td> </tr>
6
by: Bill | last post by:
Hi All, New to the whole .Net and C# thing but trying. In classic asp this was simple to fill a table with dynamic content and hyperlinks. Here is an example of what I am trying to do in classic...
3
by: sysguy | last post by:
Hello, I have a table with each <td> has four links in it. There are five cells(i.e <td>) like this and requirement is to align them horizontally on a tabbed panel menu bar. The issue is first...
3
by: =?ISO-8859-1?Q?Feij=F3?= | last post by:
I've been trying to find a code or a way to create that a parse that return this to me: $html = 'loren ipsum'; $html = 'loren ipsum 2'; $html = 'path/to/a/file'; $html = 'header 1'; $html =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.