How to scrape Google with specific search criteria using R?

383 views Asked by At

I'm trying to scrape Google with a specific search term, from a specific site, in a specific date range using R.

Example

  • Search term: "Miroslava Breach Velducea"
  • Site: www.jornada.com.mx
  • Dates: 1/1/2011 - 1/1/2012

The link for that specific search is: https://www.google.com/search?q=Miroslava+Breach+Velducea+site:www.jornada.com.mx&tbas=0&tbs=cdr:1,cd_min:1/1/2011,cd_max:1/1/2012&ei=UqCzW6LZC8OK5wKg97vYDA&start=10&sa=N&biw=1137&bih=474

When I code that in R, I can scrape Google for that search term and in that site, but not for those dates.

web_address ='https://www.google.com/search?q=miroslava+breach+velducea+site%3Awww.jornada.com.mx&tbs=cdr%3A1%2Ccd_min%3A1%2F1%2F2010%2Ccd_max%3A12%2F31%2F2011'
webpage_code = read_html(web_address)

Título = html_text(html_nodes(webpage_code,'.r a'))

Título

Does anyone know how to scrape Google general search for specific dates?

0

There are 0 answers