Skip to content

ralger

156 1 3 MIT
2.2.4 (23 Feb 2021) Dec 22 2019 268 (month)

ralger is a small web scraping framework for R based on rvest and xml2.

It's goal to simplify basic web scraping and it provides a convenient and easy to use API.

It offers functions for retrieving pages, parsing HTML using CSS selectors, automatic table parsing and auto link, title, image and paragraph extraction.

Example Use


library("ralger")

url <- "http://www.shanghairanking.com/rankings/arwu/2021"

# retrieve HTML and select elements using CSS selectors:
best_uni <- scrap(link = url, node = "a span", clean = TRUE)
head(best_uni, 5)
#>  [1] "Harvard University"
#>  [2] "Stanford University"
#>  [3] "University of Cambridge"
#>  [4] "Massachusetts Institute of Technology (MIT)"
#>  [5] "University of California, Berkeley"

# ralger can also parse HTML attributes
attributes <- attribute_scrap(
  link = "https://ropensci.org/",
  node = "a", # the a tag
  attr = "class" # getting the class attribute
)

head(attributes, 10) # NA values are a tags without a class attribute
#>  [1] "navbar-brand logo" "nav-link"          NA
#>  [4] NA                  NA                  "nav-link"
#>  [7] NA                  "nav-link"          NA
#> [10] NA
#

# ralger can automatically scrape tables:
data <- table_scrap(link ="https://www.boxofficemojo.com/chart/top_lifetime_gross/?area=XWW")

head(data)
#> # A tibble: 6 × 4
#>    Rank Title                                      `Lifetime Gross`  Year
#>   <int> <chr>                                      <chr>            <int>
#> 1     1 Avatar                                     $2,847,397,339    2009
#> 2     2 Avengers: Endgame                          $2,797,501,328    2019
#> 3     3 Titanic                                    $2,201,647,264    1997
#> 4     4 Star Wars: Episode VII - The Force Awakens $2,069,521,700    2015
#> 5     5 Avengers: Infinity War                     $2,048,359,754    2018
#> 6     6 Spider-Man: No Way Home                    $1,901,216,740    2021

Alternatives / Similar


1,495 1.0.4 (2 years ago) Nov 22 2014 compare
984 1.4.7 (1 year, 7 months ago) May 06 2012 compare
220 1.3.6 (1 year, 6 months ago) Apr 20 2015 compare
106 1.5.0 (8 months ago) Nov 09 2016 compare

Other Languages

52,322 2.32.3 (7 months ago) Feb 14 2011 compare
23,535 v2.1.0 (4 years ago) May 14 2018 compare
15,288 3.11.11 (18 days ago) Jul 26 2019 compare
8,819 3.3.2 (1 year, 1 month ago) Dec 28 2012 compare
106,075 1.7.9 (14 days ago) Aug 29 2014 compare
3,698 7.2.1 (2 months ago) Jul 03 2013 compare
1,095 1.4.1 (7 months ago) Feb 09 2011 compare
- 4.12.3 (11 months ago) Jul 26 2019 compare
13,513 0.28.1 (30 days ago) Jul 26 2019 compare
4,492 10.0.0 (13 days ago) Aug 28 2011 compare
2,737 5.3.0 (4 months ago) Dec 13 2022 compare
got
14,222 14.4.2 (4 months ago) Mar 27 2014 compare
7,566 v1.3.4 (4 years ago) Feb 15 2020 compare
5,540 0.14.2 (2 months ago) Jul 30 2007 compare
4,052 v0.6.1 (10 months ago) Feb 23 2022 compare
16,601 10.1.1 (2 months ago) Aug 22 2011 compare
28,873 1.0.0 (4 months ago) Oct 08 2011 compare
1,624 3.3.1 (1 year, 26 days ago) Dec 11 2011 compare
2,647 2025-01-01 (4 days ago) Jun 06 2019 compare
1,146 1.1 (4 years ago) Jul 30 2007 compare
669 2024-12-23 (13 days ago) Feb 09 2017 compare
292 1.2.0 (2 years ago) Apr 14 2012 compare
5,775 2.12.2 (28 days ago) Dec 19 2009 compare
6,137 1.16.7 (5 months ago) Jul 25 2009 compare
702 2.8.3 (8 years ago) Jul 25 2009 compare
1,161 1.2.3 (2 days ago) Oct 31 2009 compare
2,012 6.0.11 (1 year, 27 days ago) Jun 15 2007 compare
5,826 0.22.0 (8 months ago) Jul 25 2009 compare
2,304 2.0.1 (4 months ago) Dec 05 2008 compare
52,353 2.11.2 (7 months ago) Jul 26 2019 compare
1,163 1.9.1 (8 months ago) Jul 26 2019 compare
4,079 1.4.1 (1 year, 1 month ago) Oct 06 2009 compare
1,086 7.45.4 (24 days ago) Feb 25 2003 compare
13,764 0.10.0 (5 years ago) Feb 25 2018 compare
1,751 0.7.1 (5 months ago) Feb 23 2022 compare
23,055 7.9.1 (5 months ago) Nov 14 2011 compare
1,216 1.1.7 (4 years ago) Oct 25 2009 compare
1,186 0.3.27 (27 days ago) Mar 01 2018 compare
612 1.2.1 (2 years ago) Jun 09 2011 compare
1,933 v7.1.5 (3 months ago) Apr 28 2019 compare
1,617 2.9.0 (9 months ago) Jun 01 2013 compare
587 23.11.0 (1 year, 2 months ago) Dec 28 2012 compare
3,980 v7.2.0 (a month ago) Sep 26 2011 compare
897 1.0.2 (2 months ago) Sep 25 2013 compare
381 18.1.0 (4 months ago) Aug 06 2011 compare
707 Start (6 years ago) Feb 20 2018 compare
5,716 v0.18.0 (1 year, 9 months ago) Aug 06 2019 compare
2,038 (3 years ago) Nov 20 2016 compare
14,167 v1.10.1 (10 days ago) Aug 29 2016 compare
750 v1.3.4 (16 days ago) Feb 07 2019 compare
req
4,346 v3.49.1 (12 days ago) Aug 12 2023 compare
10,341 v3.0.0-alpha.6 (4 days ago) May 21 2020 compare
2,188 v1.2.5 (2 years ago) Apr 29 2017 compare
695 v1.3.3 (20 days ago) Jun 08 2019 compare
507 1.1.4 (4 years ago) Apr 20 2010 compare
2,980 1.5.0 (3 months ago) Sep 04 2013 compare
199 1.3.0 (4 months ago) Jul 30 2007 compare
3,573 v2.0.14 (26 days ago) Oct 06 2013 compare
6,725 2.0.2 (5 months ago) Sep 10 2012 compare
731 0.9.2 (a month ago) Feb 23 2022 compare
6,193 1.1.14 (2 years ago) Jul 26 2019 compare
2,961 v2.1.1 (1 year, 1 month ago) Jul 17 2018 compare
1,916 1.3.0 (3 months ago) Nov 11 2011 compare
2,102 v4.4.15 (3 days ago) Oct 26 2013 compare
760 1.1 (4 years ago) Dec 28 2012 compare
1,743 1.0.0 (8 months ago) Apr 14 2012 compare
682 0.4.12 (1 year, 1 month ago) Jun 03 2007 compare
810 0.7.1 (11 months ago) Jul 25 2009 compare
3,365 0.9.13 (1 year, 5 months ago) Jul 04 2017 compare
1,316 3.0.0 (2 years ago) Dec 27 2011 compare
3,184 1.5.1 (2 months ago) Sep 30 2018 compare
246 1.33.0 (10 months ago) Feb 05 2023 compare
1,754 0.8.5 (2 years ago) Oct 17 2018 compare
22 0.6.0 (1 year, 8 months ago) Jul 24 2014 compare
3,011 0.12.0 (7 years ago) Mar 20 2015 compare
11,149 1.1.9 (6 years ago) Aug 24 2018 compare
1,353 v3.2.0 (9 months ago) Dec 27 2021 compare
425 0.1.3 (1 year, 5 months ago) Feb 20 2022 compare
546 3.0.0 (8 months ago) May 04 2020 compare
212 1.0.0-beta8.4 (1 year, 6 months ago) Apr 18 2019 compare
1,335 v0.7.2 (1 year, 27 days ago) Mar 16 2013 compare
345 v3.1.0 (2 days ago) Apr 18 2022 compare
Was this page helpful?