Learn R Programming

healthforum (version 0.1.0)

scrape_one_post: Scrape one initial post

Description

Get the data from one initial post by entering its url

Usage

scrape_one_post(url, From = 1L, To = Inf, get_user_info = TRUE)

Arguments

url

URL to the post to scrape

From

The starting page number. Default is the first page

To

The ending page number. Default (Inf) is the last page (so all pages)

get_user_info

Get users' profile information. It includes the date of joining the forum and the total posts they have sent. The default is TRUE.

Value

A data frame

Examples

Run this code
# NOT RUN {
## get two pages of data from the post titled "Can Gastritis be cured?"
post_url = "https://patient.info/forums/discuss/can-gastritis-be-cured--613999"
scrape_one_post(url = post_url, From = 1, To = 2)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab