Skip to content
Back to formatted view

Raw Message

Message-ID: <4B01A824.3090306@coll.mpg.de>
Date: 2009-11-16T19:29:40Z
From: Philip Leifeld
Subject: parsing Google search results

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])
####

Thanks

Philip

-- 
Philip Leifeld
Max Planck Institute for     | +49 (0) 1577 6830349 (mobile)
Research on Collective Goods | +49 (0) 228 91416-73 (phone)
MaxNetAging Doctoral Fellow  | +49 (0) 228 91416-62 (fax)
Kurt-Schumacher-Str. 10      |
53113 Bonn, Germany          | http://www.philipleifeld.de