I’m trying to scrape the table of content of a journal published by Sage. Scraping titles and URLs is a no brainer. Scraping author names is tricky though, maybe because they open a pop-up with lots of information (affiliation, orcid, etc.), and SelectorGadget seems unable to decipher between all these. After several attempts, the following code:
author_1 <- read_html("https://journals.sagepub.com/toc/ossa/40/1") %>%
html_nodes('.all') %>%
html_text(trim = TRUE)
author_1
gives:
[1] "Andrew D. Brown Andrew D. BrownUniversity of Bath, UK View ORCID profileSee all articles by this author\nSearch Google Scholar\n for this author"
[2] "Peter Fleming Peter FlemingSee all articles by this author\nSearch Google Scholar\n for this author"
[3] "Mike Reed Mike ReedCardiff Business School, UKSee all articles by this author\nSearch Google Scholar\n for this author, Gibson Burrell Gibson BurrellUniversities of Leicester and Manchester, UK View ORCID profileSee all articles by this author\nSearch Google Scholar\n for this author"
etc.
Regex to clean this is beyond my limited skills (especially since some articles, like the 3rd one, have several authors). Any help would be greatly appreciated.