scrape_medsafe_sb#
- SurVigilance.ui.scrapers.scrape_medsafe_sb(searching_for: str, drug_vaccine: str, output_dir: str = 'data/nzmedsafe', callback: Callable[[dict], None] | None = None, headless: bool = True, num_retries: int = 5) DataFrame[source]#
Scrapes NZ Medsafe database for a given medicine or vaccine, for System Organ Class (SOC), PTs and associated count.
Parameters#
- searching_forstr
Either “medicine” or “vaccine”.
- drug_vaccinestr
The drug or vaccine name to search for.
- output_dirstr
Directory to save CSV (default “data/nzmedsafe”).
- callbackcallable
Callable to receive UI/status events, called with a dict. This is essential to show progress to user.
- headlessbool
Run the browser headless (default True).
- num_retries: int
Number of retries for data scraping after which error is thrown (default 5).
Returns#
A dataframe with columns [“SOC”, “PT”, “Count”].