473,786 Members | 2,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cleaning the mess of newssite HTML

Hi,

can anybody help me with the cleaning of really messy HTML from
the news site into really clean XHTML, which I would like to
then analyze with some qualitative analysis (probably exporting
to plain ASCII in meantime, but not necessarily). I can do some
little cleaning by hand, but when there some hundreds of
webpages, I hoped that I could create some XSL stylesheet for
conversion.

I have downloaded this page
(http://news.bostonherald.com/localRe...6&format=text;
the copy is available on
http://www.ceplovi.cz/matej/tmp/downloaded.html). Then I run it
through tidy (http://www.ceplovi.cz/matej/tmp/tidyfied.html). I
would love to get some really minimal HTML2.0-like XHTML
(something like http://www.ceplovi.cz/matej/tmp/clean.xhtml).

Is there any tool for doing things like that? I hoped to create
some XSL stylesheet myself, but I am quite newbie in XSL-arena,
and there are some things, which I did not manage to do:

1) How to say to XSL processor "skip everything between <body>
and the blocklevel tag, which contains the same text as <title>,
but without some constant text or regex (e.g.,
"\s*BostonHeral d.com.*:" or at least "BostonHerald.c om -
Local/Regional News:")"? Of course all remaining closing tags
should be omitted as well.
2) How to remove all tables without removing their content?

Does anybody know about any such solution or at least example of
such thing?

Thanks for any help,

Matej Cepl

--
Matej Cepl,
GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC
138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
Jul 23 '05 #1
0 1454

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

Similar topics

1
1536
by: Matej Cepl | last post by:
Hi, can anybody help me with the cleaning of really messy HTML from the news site into really clean XHTML, which I would like to then analyze with some qualitative analysis (probably exporting to plain ASCII in meantime, but not necessarily). I can do some little cleaning by hand, but when there some hundreds of webpages, I hoped that I could create some XSL stylesheet for conversion.
8
14275
by: Peter O'Reilly | last post by:
I have an HTML form with a textarea input box. When the user conducts a post request (e.g. clicks the submit button), an HTML preview page is presented to them with the information they have filled out in the prior page's form elements. Naturally some users like to copy and paste text into the textarea box and presumably do so from say a word processor program. Some Macintosh based users I know of experience problems with foreign...
3
2296
by: Pierre Saint-Jacques | last post by:
DB2 V8.2 has a new envir. var. DB2_USE_ALTERNATE_PAGE_CLEANING=YES The docs. mention that this will make DB2 ignore chngpgs_thresh and use softmax to even the rate of writing out of the bp's. What agent process then takes over. On a workload of 10000 trans./min., I get over 9000 bp's writes out of my snapshot. However, LSAN Gap Cleaners, Thereshold Cleansers and Victim Page Cleaners are all = 0
1
2112
by: Mikey | last post by:
Do NativeWindows get destroyed when the app shuts down? While my app is running I can Spy++ and see my NativeWindow handle. After app shutdown it's no longer there. But this is confusing because if I Spy++ on the messages, and do a DestroyHandle, I see a WM_DESTROY, but do not see this message when the app shuts down. I presume the window has indeed been destroyed, because Spy++ doesn't pick it up.
3
9621
by: turnitup | last post by:
Dear all, I have a problem with a form, and I have tried various permutations of htmlentities() and html_entity_decode() to resolve, but without success. Here is the workflow. 1: User pastes MS Word formatted text into form field. 2: Server uses mail() to send input text to mail client. 3: Recipient pastes text into html file.
1
2035
by: Steve B. | last post by:
Hi, I'm building a web site that can render html from various user input. The problem is that the html cannot be trusted, so I need to ensure it does not contain script attack injection. That's why I'd like to provide a set of allowed tag and to remove other ones. I think about regular expression. However, I was able to find some regex samples that remove a set a untrusted tags (scripts, iframe, etc), but I'd
3
1470
by: Magnus Henriksson | last post by:
Hi all, While getting ready to get rid of an old computer of mine, I came across this transform that I wrote a few years ago (around 2002 I think). I did it just to prove that it could be done, so the more mathematically inclined will no doubt find better ways to do this. I thought some of you might get a kick out of it. Do this:
3
3047
by: Jim Carlock | last post by:
I have a problem where session cookies get left inside the temporary folder. Is this a common problem or is there perhaps something I've over looked - there a way to make sure the session variables get cleaned up? -- Jim Carlock Post replies to the group.
13
3932
by: dmeglio | last post by:
Hello, I'm aware that when an EventHandler is created, it creates a reference to the object, therefore preventing GCing. Therefore, I've been implementing IDisposable in my controls to cleanup the mess (not a fun thing to retrofit). Anyway, my question is regarding this issue. When I create controls, the .NET IDE automatically registers events for me (the "Component
0
1206
by: Now You Know | last post by:
Carpet Cleaners Los Angeles Home Carpet Rug Upholstery Cleaning Phone 1 310 925 1720 OR 1-818-386-1022 Local Call California Wide We offer carpet cleaning services such as; Steam Cleaning, Dry Cleaning, Fabric Lounge Suite Cleaning, Leather Lounge Suite Cleaning, Tile & Grout Cleaning, Mattress Cleaning, Wet Carpet / Water Damage Restoration for: offices, homes, restaurants, clubs and hotels http://carpetcleanersorangecounty.blogspot.com/...
0
9492
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10163
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.