473,385 Members | 1,907 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,385 software developers and data experts.

html DOM

Is there a package that would allow me the same or similar functionality for
modifying html code via the DOM model as I have in JavaScript ? I'd like to
parse an html file, then modify it and save the result. I am not trying to
do this online, rather I would like to do this on a batch of files stored on
my hard drive. I have found several packages that allow me to parse and
dissect html but none that allow me to modify the object and save the
results -- perhaps I am overlooking the obvious
Mar 30 '08 #1
3 1798
On Sun, Mar 30, 2008 at 1:09 AM, Sam the Cat <sa**********@verizon.netwrote:
Is there a package that would allow me the same or similar functionality for
modifying html code via the DOM model as I have in JavaScript ? I'd like to
parse an html file, then modify it and save the result. I am not trying to
do this online, rather I would like to do this on a batch of files stored on
my hard drive. I have found several packages that allow me to parse and
dissect html but none that allow me to modify the object and save the
results -- perhaps I am overlooking the obvious
Have you looked at Beautiful Soup?

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

David.
Mar 30 '08 #2
On 30 Mar, 01:09, "Sam the Cat" <sam_spam_...@verizon.netwrote:
Is there a package that would allow me the same or similar functionality for
modifying html code via the DOM model as I have in JavaScript ? I'd like to
parse an html file, then modify it and save the result.
You could try libxml2dom which has an HTML parsing mode (like lxml and
other solutions based on libxml2):

http://www.python.org/pypi/libxml2dom

It attempts to provide a DOM API very much like that used by
JavaScript implementations.

Paul
Mar 30 '08 #3
Sam the Cat wrote:
Is there a package that would allow me the same or similar functionality
for modifying html code via the DOM model as I have in JavaScript ? I'd
like to parse an html file, then modify it and save the result. I am
not trying to do this online, rather I would like to do this on a batch
of files stored on my hard drive. I have found several packages that
allow me to parse and dissect html but none that allow me to modify the
object and save the results -- perhaps I am overlooking the obvious
http://codespeak.net/lxml/lxmlhtml.html

Here are some performance comparisons of HTML parsers:

http://blog.ianbicking.org/2008/03/3...r-performance/

Stefan
Apr 7 '08 #4

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

Similar topics

4
by: Francois Keyeux | last post by:
hello everyone: i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50) i know how to create a plain text...
1
by: cirillo_curiosone | last post by:
Hi, i'm new to javascript. I started studing it on the web few weeks ago, but still haven't been able to solve one big problem: HOT TO PASS VALUES FROM A SCRIPT VARIABLE TO A CHILD HTML...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
5
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
9
by: anupamjain | last post by:
Hi, After 2 weeks of search/hit-and-trial I finally thought to revert to the group to find solution to my problem.(something I should have done much earlier) This is the deal : On a JSP...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
6
by: Guy Macon | last post by:
cwdjrxyz wrote: HTML 5 has solved the above probem. See the following web page: HTML 5, one vocabulary, two serializations http://www.w3.org/QA/2008/01/html5-is-html-and-xml.html
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
4
Dököll
by: Dököll | last post by:
Hey Gang! I thought I had a good idea but then I realized JSF doesn't play that... I am trying to mimick what HTML can do in JSF when using target tags to related to inner HTML pages. In...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.