Web scraping of multiple urls

Hi,

I need to scrap multiple pages from the web and parse them to data frames.

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(purrr)
library(tidyverse)  
library(stringr)
library(xml2)
library(rvest)
#> 
#> Attaching package: 'rvest'
#> The following object is masked from 'package:readr':
#> 
#>     guess_encoding
#> The following object is masked from 'package:purrr':
#> 
#>     pluck

url <- "https://amx.am/en/9/trading/10/instruments"

amx <- read_html(url)

amx_1 <- amx %>% html_table()%>% reduce(left_join, by = "X1")
amx_1
#>                            X1
#> 1                      Ticker
#> 2                      Issuer
#> 3                        ISIN
#> 4             Admittance date
#> 5                       Class
#> 6            Listing category
#> 7                    Currency
#> 8  Nominal value per security
#> 9                    Quantity
#> 10       Quantity outstanding
#> 11                     Volume
#> 12              Maturity date
#> 13                   Duration
#> 14                 Coupon (%)
#> 15         Number of payments
#> 16               Coupon dates
#> 17                 Issue date
#> 18                     Status
#>                                                                                                                      X2.x
#> 1                                                                                                                 0N60294
#> 2                                                                          Ministry of Finance of the Republic of Armenia
#> 3                                                                                                            AMGN60294201
#> 4                                                                                                              29.04.2015
#> 5                                                                                                             Coupon bond
#> 6                                                                                                                   Gbond
#> 7                                                                                                                     AMD
#> 8                                                                                                                  100.00
#> 9                                                                                                             282,415,000
#> 10                                                                                                            282,415,000
#> 11                                                                                                      28,241,500,000.00
#> 12                                                                                                             29.04.2020
#> 13                                                                                                              60 months
#> 14                                                                                                                    10%
#> 15                                                                                                                     10
#> 16 29/10/2015, 29/04/2016, 29/10/2016, 29/04/2017, 29/10/2017, 29/04/2018, 29/10/2018, 29/04/2019, 29/10/2019, 29/04/2020
#> 17                                                                                                             29.04.2015
#> 18                                                                                                    Admitted to trading
#>                                                                                                                      X2.y
#> 1                                                                                                                 1N60294
#> 2                                                                          Ministry of Finance of the Republic of Armenia
#> 3                                                                                                            AMGN60294219
#> 4                                                                                                              29.04.2016
#> 5                                                                                                             Coupon bond
#> 6                                                                                                                   Gbond
#> 7                                                                                                                     AMD
#> 8                                                                                                                  100.00
#> 9                                                                                                             465,000,000
#> 10                                                                                                            465,000,000
#> 11                                                                                                      46,500,000,000.00
#> 12                                                                                                             29.04.2021
#> 13                                                                                                              60 months
#> 14                                                                                                                    10%
#> 15                                                                                                                     10
#> 16 29/10/2016, 29/04/2017, 29/10/2017, 29/04/2018, 29/10/2018, 29/04/2019, 29/10/2019, 29/04/2020, 29/10/2020, 29/04/2021
#> 17                                                                                                             29.04.2016
#> 18                                                                                                    Admitted to trading
#>                                                                    X2.x.x
#> 1                                                                 2N36294
#> 2                          Ministry of Finance of the Republic of Armenia
#> 3                                                            AMGN36294202
#> 4                                                              29.04.2017
#> 5                                                             Coupon bond
#> 6                                                                   Gbond
#> 7                                                                     AMD
#> 8                                                                  100.00
#> 9                                                             304,845,000
#> 10                                                            304,845,000
#> 11                                                      30,484,500,000.00
#> 12                                                             29.04.2020
#> 13                                                              36 months
#> 14                                                                     8%
#> 15                                                                      6
#> 16 29/10/2017, 29/04/2018, 29/10/2018, 29/04/2019, 29/10/2019, 29/04/2020
#> 17                                                             29.04.2017
#> 18                                                    Admitted to trading
<sup>Created on 2020-01-18 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)</sup>

I need to do this with multiple pages.
here is the list of my pages.

list_of_pages <- str_c(url, '?page=', 1:3)
#> Error in str_c(url, "?page=", 1:3): could not find function "str_c"

list_of_pages
#> Error in eval(expr, envir, enclos): object 'list_of_pages' not found

Created on 2020-01-18 by the reprex package (v0.3.0)

Actually what I need is to scrap multiple pages

It says that you deleted your post. If you ever repost it, I will be able to help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.