473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML Parser for Jython

Does anybody know of a decent HTML parser for Jython? I have to do
some screen scraping, and would rather use a tested module instead of
rolling my own.

Thanks!

GP

Oct 17 '07 #1
4 2370
Falcolas wrote:
Does anybody know of a decent HTML parser for Jython? I have to do
some screen scraping, and would rather use a tested module instead of
rolling my own.
Not sure if it works, but have you tried BeautifulSoup? Or maybe an older
version of it?

Stefan
Oct 17 '07 #2
On Wed, 2007-10-17 at 17:36 +0200, Stefan Behnel wrote:
Falcolas wrote:
Does anybody know of a decent HTML parser for Jython? I have to do
some screen scraping, and would rather use a tested module instead of
rolling my own.

Not sure if it works, but have you tried BeautifulSoup? Or maybe an older
version of it?
Recent releases of BeautifulSoup need Python 2.3+, so they won't work on
current Jython, but BeatifulSoup 1.x will work.

--
Carsten Haese
http://informixdb.sourceforge.net
Oct 17 '07 #3
Does anybody know of a decent HTML parser for Jython? I have to do
some screen scraping, and would rather use a tested module instead of
rolling my own.
GIYF[0][1]
There are the batteries-included HTMLParser[2] and htmllib[3]
modules, and the ever-popular (and more developer-friendly)
BeautifulSoup[4] library as the first three results. For running
BS in Jython, it's recommended[5] to use an older (1.x?) version
which are available at the BS site[6]

-tkc

[0]http://en.wikipedia.or g/wiki/GIYF#G
[1]http://www.google.com/search?q=python %20html%20parse r
[2]http://docs.python.org/lib/module-HTMLParser.html
[3]http://docs.python.org/lib/module-htmllib.html
[4]http://www.crummy.com/software/BeautifulSoup/
[5]http://mail.python.org/pipermail/python-list/2007-May/439618.html
[6]http://www.crummy.com/software/BeautifulSoup/download/1.x/


Oct 17 '07 #4
On Oct 17, 9:50 am, Carsten Haese <cars...@uniqsy s.comwrote:
Recent releases of BeautifulSoup need Python 2.3+, so they won't work on
current Jython, but BeatifulSoup 1.x will work.
Thank you.

Oct 17 '07 #5

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

Similar topics

6
12411
by: Paul Rubin | last post by:
Is there an HTML DOM parser available for Python? Preferably one that does a reasonable job with the crappy HTML out there on real web pages, that doesn't get upset about unterminated tables and stuff like that. Many extra points if it understands Javascript. Application is a screen scraping web robot. Thanks.
4
2443
by: Leif K-Brooks | last post by:
I'm writing a site with mod_python which will have, among other things, forums. I want to allow users to use some HTML (<em>, <strong>, <p>, etc.) on the forums, but I don't want to allow bad elements and attributes (onclick, <script>, etc.). I would also like to do basic validation (no overlapping elements like <strong><em>foo</em></strong>, no missing end tags). I'm not asking anyone to write a script for me, but does anyone have general...
4
3418
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
1
2283
by: scott | last post by:
I installed darwinports and did a "sudo port install jython" ------------------------- scott$ which jython /opt/local/bin/jython ------------------------- Jython works in interactive mode as shown below:
3
3118
by: Himanshu Garg | last post by:
Hello, I am trying to pinpoint an apparent bug in HTML::Parser. The encoding of the text seems to change incorrectly if the locale isn't set properly. However Parser.pm in the directory (/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/) doesn't seem to contain the "real" parsing statements.
18
14737
by: SwordAngel | last post by:
Hello, I'm looking for a program that converts characters of different encodings (such as EUC-JP, Big5, GB-18030, etc.) into HTML ampersand escape sequences. Anybody knows where I can find one? thx.
12
5904
by: Mark Fink | last post by:
I wrote a Jython class that inherits from a Java class and (thats the plan) overrides one method. Everything should stay the same. If I run this nothing happens whereas if I run the Java class it says: usage: java fit.FitServer host port socketTicket -v verbose I think this is because I do not understand the jython mechanism for inheritance (yet).
4
1439
by: HMS Surprise | last post by:
Could you recommend an html parser that works with python (jython 2.2)? HTMLParser does not seem to be in this library. To test some of our browser based (mailnly php) code I seek for field names and values associated with them. Thanks, jh
5
3600
by: sarup26 | last post by:
Hello .. I would like to know more about Python and Jython? What is the difference between both of them? What is the future for Jython and which are the areas where it is used? Swot
0
7936
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7874
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
8241
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
8366
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...
1
7997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5402
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3853
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
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.