Re: parsing the result of google query

Carlo Capelli <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CABty9wxNLCSxrEdAejiUaXVtdsc2k_dbePw9KS6Q0vvEWkSyqQ@mail.gmail.com>
Hi Josef

I think you could try library(xpath). Here a dummy sample

?- xpath(element(a, [], [before, element(p, [], [x,y,z]),
after]),/self(normalize_space), Text).
Text = beforexyzafter .


You can see how it 'destructures' XML removing tags. You get XML if you use
load_html_file<http://www.swi-prolog.org/pldoc/man?predicate=load_html_file/2>from
library(sgml)

HTH Carlo


2013/7/6 Josef Frydl <[email protected]>

> Hi, I am writing the small system in swi-prolog, which would search google
> and then bring down   individual sites and hrefs. which are in the query
> result.  Before I reinvent the wheel, let me ask you if there is already
> the utility which would would pick only
> this    www.swi-prolog.org  from this
>  <cite>www.swi-<b>prolog</b>.org/</cite>
> and
> http://en.wikipedia.org/wiki  from this href="/url?q=
> http://en.wikipedia.org/wiki/
> Also later I would need to get just plain test from html document
> Thanks Josef Frydl
>
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.