user3719979
user3719979

Reputation: 163

pulling data from web search form using Rcurl/httr

I'm a beginner in web scraping and not trying to figure out the issue I am facing in pulling the data from web search form.

The form looks something like below.

Details of practitioner

Given name:
Gender

My code looks like below.

  pars <- list('Given Name' = "Price", Gender = 'Male' )
  html.post= postForm("url.aspx",
               .params = pars,.opts = list(ssl.verifypeer = FALSE))

  cat(html.post,file = ".//temp.html",append=FALSE)

the link to the site I am searching is:Link

but I am not getting data after the passing the above values.

Can anyone help me where I am going wrong.

Any help from you will be gratefull.

Upvotes: 0

Views: 154

Answers (1)

Liz Young
Liz Young

Reputation: 408

I corrected your link in my code below (your link was missing an ':') this code gets data and prints it out. Good luck.

library(RCurl)
library(httr)

target.url <- 'http://webcache.gmc-uk.org/gmclrmp_enu/start.swe?SWECmd=GotoView&_sn=bx5WiC.Raa.SYqbnVtdnDW2rzaI8FAhP6LIIZidsaFQ7mFgRcL9RMEGs5G1iZYGFhJQFTxPGGcTusD5UHTnjx7vw3M2GH5ckKQE1bzd-N1QM8fDrNn7PpvmuWs14rgCsyPMFfg2oz3RmTO0aE6hJaMKWpflME90ANAFZCa.L5NW5A9on8rf4ZdVCnr1Mwkb.kwiDKB2kdPI_&SWEView=GMC%20WEB%20Doctor%20Search&SRN=&SWEHo=webcache.gmc-uk.org&SWETS=1429625652&SWEApplet=GMC%20WEB%20Health%20Provider%20Search%20Applet'

pars <- list('Given Name' = "Price", Gender = 'Male' )
html.post = postForm(target.url, .params = pars,.opts = list(ssl.verifypeer = FALSE))
print(html.post)

Upvotes: 1

Related Questions