Re: [Factor-talk] Using find-by-class in html.parser.analyzer

2013-07-16 Thread Björn Lindqvist
2013/7/16 Alex Vondrak > IN: scratchpad "mmm, candy > bar" parse-html > [ "class" attribute " " split "food" swap member? ] find-all . > > { > { > 2 > T{ tag > { name "div" } > { attributes H{ { "class" "food is good" } } } > } > } > } > > H

Re: [Factor-talk] Using find-by-class in html.parser.analyzer

2013-07-15 Thread Alex Vondrak
On Mon, Jul 15, 2013 at 12:11 PM, Mark Green wrote: > I expect it could be written up as a quotation. > Maybe something like this? ``` IN: scratchpad "mmm, candy bar" parse-html [ "class" attribute "foo" swap subseq? ] find-all . { { 2 T{ tag { name "div" }

Re: [Factor-talk] Using find-by-class in html.parser.analyzer

2013-07-15 Thread Mark Green
Hi Alex, Thanks very much for your reply. I think my issue might come from the fact that find-by-class or its XML equivalent require the entire class string to match which is technically not correct (an element can have several CSS classes so it should be a "string contains as a whole word" type s

Re: [Factor-talk] Using find-by-class in html.parser.analyzer

2013-07-15 Thread Björn Lindqvist
2013/7/15 Alex Vondrak > > In general, I'm not sure if html.parser is very mature compared to, say, > the XML vocab: http://docs.factorcode.org/content/article-xml.html The major difference is that html.parser handles invalid html which the xml vocab doesn't. So for parsing pages on the web, h

Re: [Factor-talk] Using find-by-class in html.parser.analyzer

2013-07-14 Thread Alex Vondrak
No docs apparently (and unfortunately), but I suppose you can get a feel for what the words do by looking at the source + tests. That's what I've done to give you this reply, anyhow. :-) I'm not sure how you were invoking the word before to not see the desired behavior---I'm guessing probably on

[Factor-talk] Using find-by-class in html.parser.analyzer

2013-07-14 Thread Mark Green
Hi, Is there any documentation for find-by-class in html.parser.analyzer? I'm not sure what it does. It doesn't seem to search for elements with a given value in the class attribute and I'm not sure how it would return them anyway (is it a filter?) Thanks!