-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
52 lines (39 loc) · 1.75 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# webbotparseR <img src="man/figures/logo.png" align="right" height="139" />
<!-- badges: start -->
[![Codecov test coverage](https://codecov.io/gh/schochastics/webbotparseR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/gesistsa/webbotparseR?branch=main)
[![R-CMD-check](https://github.com/schochastics/webbotparseR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/gesistsa/webbotparseR/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
webbotparseR allows to parse search engine results that where scraped with the [WebBot](https://github.com/gesiscss/WebBot) browser extension. A similar python library is [also available](https://github.com/gesiscss/WebBot-tutorials).
## Installation
You can install the development version of webbotparseR like so:
``` r
remotes::install_github("schochastics/webbotparseR")
```
The package contains an example html from a google search on climate change.
```{r ex_file}
library(webbotparseR)
ex_file <- system.file("www.google.com_climatechange_text_2023-03-16_08_16_11.html", package = "webbotparseR")
```
Such search results can be parsed via the function `parse_search_results()`. The parameter `engine` is used to specify the
search engine and the search type.
```{r parse}
output <- parse_search_results(path = ex_file, engine = "google text")
output
```
Note that images are always returned base64 encoded.
```{r image}
output$image[1]
```
The function `base64_to_img()` can be used to decode the image and save it in an appropriate format.