Skip to content

ralger

153 1 3 MIT
2.2.4 (23 Feb 2021) Dec 22 2019 1.2 thousand (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,455 1.0.4 (1 year, 7 months ago) Nov 22 2014 compare
979 1.4.7 (10 months ago) May 06 2012 compare
216 1.3.6 (9 months ago) Apr 20 2015 compare
101 1.4.0 (1 year, 7 months ago) Nov 09 2016 compare

Other Languages

51,138 2.31.0 (10 months ago) Feb 14 2011 compare
8,631 3.3.2 (4 months ago) Dec 28 2012 compare
22,036 v2.1.0 (3 years ago) May 14 2018 compare
103,590 1.6.7 (a month ago) Aug 29 2014 compare
3,539 7.1.2 (8 months ago) Jul 03 2013 compare
1,073 1.3.0 (6 months ago) Feb 09 2011 compare
4,263 9.1.0 (2 months ago) Aug 28 2011 compare
14,508 3.9.3 (2 months ago) Jul 26 2019 compare
- 4.12.3 (2 months ago) Jul 26 2019 compare
got
13,904 14.2.1 (30 days ago) Mar 27 2014 compare
2,562 5.2.1 (3 days ago) Dec 13 2022 compare
7,526 v1.3.4 (4 years ago) Feb 15 2020 compare
12,154 0.27.0 (a month ago) Jul 26 2019 compare
5,361 0.13.0 (1 year, 10 months ago) Jul 30 2007 compare
16,536 8.1.2 (7 months ago) Aug 22 2011 compare
27,690 1.0.0-rc.12 (4 months ago) Oct 08 2011 compare
1,611 3.3.1 (3 months ago) Dec 11 2011 compare
2,470 2024-04-04 (a day ago) Jun 06 2019 compare
1,092 1.1 (3 years ago) Jul 30 2007 compare
281 1.2.0 (1 year, 5 months ago) Apr 14 2012 compare
641 2024-04-04 (a day ago) Feb 09 2017 compare
5,646 2.9.0 (2 months ago) Dec 19 2009 compare
6,097 1.16.3 (21 days ago) Jul 25 2009 compare
697 2.8.3 (7 years ago) Jul 25 2009 compare
2,270 2.0.0 (1 year, 3 months ago) Dec 05 2008 compare
1,821 6.0.11 (3 months ago) Jun 15 2007 compare
1,152 0.110.0 (24 days ago) Oct 31 2009 compare
5,745 0.21.0 (1 year, 3 months ago) Jul 25 2009 compare
50,703 2.11.1 (a month ago) Jul 26 2019 compare
1,067 1.9.0 (22 days ago) Jul 26 2019 compare
1,041 7.45.3 (a month ago) Feb 25 2003 compare
13,558 0.10.0 (5 years ago) Feb 25 2018 compare
4,057 1.4.1 (4 months ago) Oct 06 2009 compare
22,795 7.8.0 (7 months ago) Nov 14 2011 compare
663 0.4.12 (4 months ago) Jun 03 2007 compare
2,833 1.4.3 (6 months ago) Sep 04 2013 compare
1,218 1.1.7 (3 years ago) Oct 25 2009 compare
383 18.1.0 (2 months ago) Aug 06 2011 compare
1,869 v7.0.6 (4 days ago) Apr 28 2019 compare
876 0.11.0 (3 years ago) Sep 25 2013 compare
3,892 v7.0.4 (a month ago) Sep 26 2011 compare
1,460 2.9.0 (6 days ago) Jun 01 2013 compare
608 1.2.1 (1 year, 9 months ago) Jun 09 2011 compare
946 0.3.21 (26 days ago) Mar 01 2018 compare
583 23.11.0 (5 months ago) Dec 28 2012 compare
693 v1.3.0 (1 year, 2 months ago) Feb 07 2019 compare
675 Start (6 years ago) Feb 20 2018 compare
646 (a day ago) Jun 08 2019 compare
2,025 (2 years ago) Nov 20 2016 compare
13,502 v1.9.1 (a month ago) Aug 29 2016 compare
9,116 v2.11.0 (3 months ago) Aug 25 2018 compare
req
3,977 v3.43.1 (25 days ago) Jun 08 2023 compare
2,116 v1.2.5 (2 years ago) Apr 29 2017 compare
5,606 v0.18.0 (1 year, 9 days ago) Aug 06 2019 compare
506 1.1.4 (4 years ago) Apr 20 2010 compare
6,609 1.5.0 (3 months ago) Sep 10 2012 compare
3,555 v2.0.11 (11 days ago) Oct 06 2013 compare
175 1.2.3 (2 months ago) Jul 30 2007 compare
730 1.1 (3 years ago) Dec 28 2012 compare
2,878 v2.1.1 (4 months ago) Jul 17 2018 compare
1,918 1.2.1 (2 years ago) Nov 11 2011 compare
1,732 0.3.2 (4 years ago) Apr 14 2012 compare
2,063 v4.4.10 (3 months ago) Oct 26 2013 compare
5,894 1.1.14 (1 year, 8 months ago) Jul 26 2019 compare
2,983 1.5.0 (a month ago) Sep 30 2018 compare
1,300 3.0.0 (1 year, 7 months ago) Dec 27 2011 compare
791 0.7.1 (2 months ago) Jul 25 2009 compare
235 1.33.0 (a month ago) Feb 05 2023 compare
22 0.6.0 (11 months ago) Jul 24 2014 compare
3,199 0.9.13 (8 months ago) Jul 04 2017 compare
1,731 0.8.5 (1 year, 6 months ago) Oct 17 2018 compare
2,983 0.12.0 (6 years ago) Mar 20 2015 compare
10,458 1.1.9 (5 years ago) Aug 24 2018 compare
1,315 v3.2.0 (2 days ago) Dec 27 2021 compare
491 2.0.0 (9 months ago) May 04 2020 compare
195 1.0.0-beta8.4 (9 months ago) Apr 18 2019 compare
1,320 v0.7.2 (3 months ago) Mar 16 2013 compare
411 0.1.3 (8 months ago) Feb 20 2022 compare
298 v1.7.2 (17 days ago) Apr 18 2022 compare