Hi Philip,
If i understood correctly, you just wish to get the urls from a given
google search? I have some old code you could adapt which extracts the
main links from a google search. It makes use of XPath expressions
using the lovely XML and RCurl packages:
> library(XML)
> library(RCurl)
>
> g
On Mon, Nov 16, 2009 at 7:29 PM, Philip Leifeld wrote:
> Hi,
>
> how can I parse Google search results? The following code returns
> "integer(0)" instead of "1" although the results of the query clearly
> contain the regex "cran".
>
>
> address <- url("http://www.google.com/search?q=cran";)
>
Hi,
how can I parse Google search results? The following code returns
"integer(0)" instead of "1" although the results of the query clearly
contain the regex "cran".
address <- url("http://www.google.com/search?q=cran";)
open(address)
lines <- readLines(address)
grep("cran", lines[3])
##
3 matches
Mail list logo