find_a_gp: Scrape GP practices

View source: R/utils-nhs.R

find_a_gpR Documentation

Scrape GP practices

Description

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

## Not run: 
# 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()

## End(Not run)

villegar/scrappy documentation built on Jan. 25, 2024, 4:38 p.m.