Skip to contents

Scrape GP practices near a given postcode

Usage

find_a_gp(
  client,
  postcode,
  base = "https://www.nhs.uk/service-search/find-a-gp",
  sleep = 1
)

Arguments

client

RSelenium client.

postcode

String with the target postcode.

base

String with the base URL for Google Maps website.

sleep

Integer with number of seconds to use as pause between actions on the web page.

Value

Data frame with GP practices near the given postcode.

Examples

if (FALSE) {
# Create RSelenium session
rD <- RSelenium::rsDriver(browser = "firefox", port = 4544L, verbose = FALSE)

# Retrieve GP practices near L69 3GL
# (Waterhouse building, University of Liverpool)
wh_gps_tb <- scrappy::find_a_gp(rD$client, postcode = "L69 3GL")

# Stop server
rD$server$stop()
}