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

Converting HTML to ASCII

Hi. I'm looking for a Python lib to convert HTML to
ASCII. Of course, a quick Google search showed
several options (although, I must say, less than I
would expect, considering how easy this is to do in
*other* languages... :| ), but, I have 2 requirements,
which none of them seem to meet:

1) Be able to handle badly formed, or illegal, HTML,
as best as possible. Some of the converters I tried
ended up dieing on a weird character (that is, a high
ascii char). Others somehow got confused and dumped
the JavaScript as well.

2) Not embellish the text in any way - no asterisks,
no bracket links, no __ for underlines.

Can anyone direct me to something which could help me
for this?

--Thanks a mil.

__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
Jul 18 '05 #1
3 3169
gf gf <un**************@yahoo.com> wrote:
Hi. I'm looking for a Python lib to convert HTML to
ASCII. Of course, a quick Google search showed
several options (although, I must say, less than I
would expect, considering how easy this is to do in
*other* languages... :| ), but, I have 2 requirements,
which none of them seem to meet:

1) Be able to handle badly formed, or illegal, HTML,
as best as possible. Some of the converters I tried
ended up dieing on a weird character (that is, a high
ascii char). Others somehow got confused and dumped
the JavaScript as well.

2) Not embellish the text in any way - no asterisks,
no bracket links, no __ for underlines.

Can anyone direct me to something which could help me
for this?


man lynx
man links
man w3m

--
William Park <op**********@yahoo.ca>, Toronto, Canada
Slackware Linux -- because I can type.

Jul 18 '05 #2
Try Beautiful Soup!
1) Be able to handle badly formed, or illegal, HTML,
as best as possible. From the description:
"It won't choke if you give it ill-formed markup: it'll just give you access to
a correspondingly ill-formed data structure."
Can anyone direct me to something which could help me
for this?

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

Hans Christian
Jul 18 '05 #3
gf gf wrote:
Hi. I'm looking for a Python lib to convert HTML to
ASCII.


You might find these threads on comp.lang.python interesting:
http://tinyurl.com/5zmpn
http://tinyurl.com/6mxmb

Kent
Jul 18 '05 #4

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

Similar topics

3
by: gf gf | last post by:
Hans, Thanks for the tip. I took a look at Beatiful Soup, and it looked like it was a framework to parse HTML. I'm not really interetsed in going through it tag by tag - just to get it...
1
by: darrel | last post by:
I have two issues: 1) The WYSIWYG content editor we're using for our CMS doesn't truly support xhtml. 2) .net doesn't truly support xhtml my question is if there is a .net...
1
by: Stu | last post by:
Hi, I need to find a method of converting html in to a PDF document on teh server. Can anyone suggest the best way of doing this? Thanks in advance, Stu
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...
6
by: McHenry | last post by:
When parsing HTML is it possible to have all the ASCII codes converted to their real values first so that I do not need to search for them to exclude them. For example the following is retrieved...
3
by: varuna | last post by:
Hi, I have doubt on converting html page to .net i mean if i designed a page in frontpage or in a Dreamweaver so that page i mean instead of designing a web page in .net using toolbox i need to...
4
by: 0310889 | last post by:
I am doing my honours project at uni and have to use C programming and the IIC bus, not the best combination as I have never done that much programming and I had never heard of the IIC bus! Anyway,...
1
by: Software Engineer | last post by:
Testing htmlspecialchars() PHP Function - Converting HTML Characters http://sqa.fyicenter.com/Online_Test_Tools/Test_htmlspecialchars_PHP_Function.php When data needs to be presented in Web...
9
Thekid
by: Thekid | last post by:
How do you go about converting something to ASCII using python? I have an example below of some randomly generated text that would need converted: 96,114,101,106,60, Shift: 27 I don't know...
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
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...

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.