Re: [Pharo-project] Parsing and navigating Html
On 12/05/2010 06:02 AM, pharo-project-request@lists.gforge.inria.fr wrote:
From: St?phane Ducasse<stephane.ducasse@inria.fr> Subject: [Pharo-project] Parsing and navigating Html To:"Pharo-project@lists.gforge.inria.fr Development" <Pharo-project@lists.gforge.inria.fr> Message-ID:<1C53DFD8-3021-4233-BC83-CE8C1EA8D103@inria.fr> Content-Type: text/plain; charset=us-ascii
Hi
I would like extract partial information from HTML pages. So I started to play and fix HTMLParser.
Now does anybody know alternatives?
Second, does anybody develop a lib to query HTML structure as with the XMLSupport package?
Stef
The Soup package on SqueakSource.com works OK.
thanks paul I will have a look now. Stef
On 12/05/2010 06:02 AM, pharo-project-request@lists.gforge.inria.fr wrote:
From: St?phane Ducasse<stephane.ducasse@inria.fr> Subject: [Pharo-project] Parsing and navigating Html To:"Pharo-project@lists.gforge.inria.fr Development" <Pharo-project@lists.gforge.inria.fr> Message-ID:<1C53DFD8-3021-4233-BC83-CE8C1EA8D103@inria.fr> Content-Type: text/plain; charset=us-ascii
Hi
I would like extract partial information from HTML pages. So I started to play and fix HTMLParser.
Now does anybody know alternatives?
Second, does anybody develop a lib to query HTML structure as with the XMLSupport package?
Stef
The Soup package on SqueakSource.com works OK.
Hi paul There is not one single class comments :( Do you have an example? I got two tests red, it is normal? I'm sad because this is really not like that, that we will attract people to Smalltalk. Stef On Dec 5, 2010, at 5:19 PM, Paul DeBruicker wrote:
On 12/05/2010 06:02 AM, pharo-project-request@lists.gforge.inria.fr wrote:
From: St?phane Ducasse<stephane.ducasse@inria.fr> Subject: [Pharo-project] Parsing and navigating Html To:"Pharo-project@lists.gforge.inria.fr Development" <Pharo-project@lists.gforge.inria.fr> Message-ID:<1C53DFD8-3021-4233-BC83-CE8C1EA8D103@inria.fr> Content-Type: text/plain; charset=us-ascii
Hi
I would like extract partial information from HTML pages. So I started to play and fix HTMLParser.
Now does anybody know alternatives?
Second, does anybody develop a lib to query HTML structure as with the XMLSupport package?
Stef
The Soup package on SqueakSource.com works OK.
Hi paul I started to write some comments and more tests as well as writing a small Documentation. May be to be turned into a Help later. Now a question, I tried to write a comment for and I was wondering why not returning '' instead of nil in string. It will avoid to have isNil everywhere. I did not touch that code for now. string ^ (children size = 1 and: [(children at: 1) isString]) ifTrue: [(children at: 1) contents] ifFalse: [nil] testString | soup | soup := Soup fromString: '<b>foo</b>'. self assert: (soup b string = 'foo'). soup := Soup fromString: '<b>f<i>e</i>o</b>'. self assert: (soup b string) isNil Stef
Stéphane Ducasse wrote
Now a question, I tried to write a comment for and I was wondering why not returning '' instead of nil in string.
Ten years after your question, I stumbled upon a SO answer [1] that seems to explain this behavior. Apparently `string` returns a string-like object *that retains tree navigation ability* e.g. sibling, parent, where `text` returns a bare string. From this perspective, `nil` seems appropriate to indicate that such a navigable object was not available. That said, it certainly can make the library harder to deal with. What about a Null Object Pattern that returns an object polymorphic with SoupString and that implements appropriate no-ops? 1. https://stackoverflow.com/a/25328374 ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
participants (3)
-
Paul DeBruicker -
Sean P. DeNigris -
Stéphane Ducasse