getLinkFromPage: RCSB Link Scraper Function

Description Usage Arguments Details Examples

View source: R/search_functions.R

Description

This function allows you to scrape a unique link specified by an XPath, applied on an individual RCSB structure page. Concretely, this lets you obtain links to assets (like the FASTA file, PDB file, mmCIF file, etc.) if you have the corresponding XPath for that <a> element.

Usage

1
getLinkFromPage(url, path, prepend = "http://www.rcsb.org")

Arguments

url

The url corresponding to the RCSB Structure Page in question

path

The path of the <a> element you're wanting to scrape a link from

prepend

Any string you want to prepend to the results

Details

To apply this to a vector, see 'getLinksFromPages“

Examples

1
2
3
4
# This gets the FASTA file link associated with the 6B4V structure on RCSB
url <- "http://www.rcsb.org/structure/6B4V"
fasta_path <- '//*[@id="DownloadFilesButton"]/ul/li[1]/a'
getLinkFromPage(url, fasta_path)

lacoperon/MDScraperTools documentation built on May 28, 2019, 12:59 p.m.