Skip to content

Commit

Permalink
Restyled by whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Jun 14, 2022
1 parent 3363cb1 commit a52ee28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Title: Easy Web Scraping
Version: 2.2.4
Authors@R: c(
person("Mohamed El Fodil", "Ihaddaden", email = "[email protected]", role = c("aut", "cre")),
person("Ezekiel", "Ogundepo", role = c("ctb")),
person("Romain", "François", email = "[email protected]", role = c("ctb")))
person("Ezekiel", "Ogundepo", role = c("ctb")),
person("Romain", "François", email = "[email protected]", role = c("ctb")))
Maintainer: Mohamed El Fodil Ihaddaden <[email protected]>
Description: The goal of 'ralger' is to facilitate web scraping in R.
Description: The goal of 'ralger' is to facilitate web scraping in R.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
URL: https://github.com/feddelegrand7/ralger
BugReports: https://github.com/feddelegrand7/ralger/issues
VignetteBuilder: knitr
Imports:
Imports:
rvest,
xml2,
tidyr,
Expand All @@ -24,7 +24,7 @@ Imports:
crayon,
curl,
stringi
Suggests:
Suggests:
knitr,
testthat,
rmarkdown,
Expand Down
23 changes: 11 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -89,27 +89,27 @@ head(scrap(links, node), 10) # printing the first 10 speakers

## `attribute_scrap()`

If you need to scrape some elements' attributes, you can use the `attribute_scrap()` function as in the following example:
If you need to scrape some elements' attributes, you can use the `attribute_scrap()` function as in the following example:


```{r}
# Getting all classes' names from the anchor elements
# from the ropensci website
# from the ropensci website
attributes <- attribute_scrap(link = "https://ropensci.org/",
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
```

Another example, let's we want to get all javascript dependencies within the same web page:
Another example, let's we want to get all javascript dependencies within the same web page:

```{r}
js_depend <- attribute_scrap(link = "https://ropensci.org/",
node = "script",
js_depend <- attribute_scrap(link = "https://ropensci.org/",
node = "script",
attr = "src")
js_depend
Expand Down Expand Up @@ -283,21 +283,21 @@ images_scrap(link = "https://rstudio.com/",
```


# Accessibility related functions
# Accessibility related functions


## `images_noalt_scrap()`
## `images_noalt_scrap()`


`images_noalt_scrap()` can be used to get the images within a specific web page that don't have an `alt` attribute which can be annoying for people using a screen reader:
`images_noalt_scrap()` can be used to get the images within a specific web page that don't have an `alt` attribute which can be annoying for people using a screen reader:


```{r}
images_noalt_scrap(link = "https://www.r-consortium.org/")
```
If no images without `alt` attributes are found, the function returns `NULL` and displays an indication message:
If no images without `alt` attributes are found, the function returns `NULL` and displays an indication message:


```{r}
Expand All @@ -311,4 +311,3 @@ images_noalt_scrap(link = "https://webaim.org/techniques/forms/controls")
## Code of Conduct

Please note that the ralger project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

0 comments on commit a52ee28

Please sign in to comment.