# Load packages
library(rvest)
## Loading required package: xml2
library(stringr)
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
GBIME_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=GBIME") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
HBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=HBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
KBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=KBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
LBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=LBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
ADBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=ADBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
MBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=MBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
MEGA_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=MEGA") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
CBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=CBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NABIL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NABIL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NBB_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NBB") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NCCB_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NCCB") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
CCBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=CCBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NIB_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NIB") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NICA_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NICA") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
BOKL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=BOKL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
NMB_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=NMB") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
PCBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=PCBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
PRVU_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=PRVU") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
SANIMA_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=SANIMA") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
SBI_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=SBI") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
SBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=SBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
SCB_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=SCB") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
SRBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=SRBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
CZBIL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=CZBIL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
EBL_e <- read_html("https://merolagani.com/CompanyDetail.aspx?symbol=EBL") %>% html_nodes("table") %>% .[3] %>% html_table(fill = TRUE) %>% .[[1]]
GBIME<-GBIME_e[1:14,1:2]
HBL<-HBL_e[1:14,1:2]
KBL<-KBL_e[1:14,1:2]
LBL<-LBL_e[1:14,1:2]
ADBL<-ADBL_e[1:14,1:2]
MBL<-MBL_e[1:14,1:2]
MEGA<-MEGA_e[1:14,1:2]
CBL<-CBL_e[1:14,1:2]
NABIL<-NABIL_e[1:14,1:2]
NBB<-NBB_e[1:14,1:2]
NBL<-NBL_e[1:14,1:2]
NCCB<-NCCB_e[1:14,1:2]
CCBL<-CCBL_e[1:14,1:2]
NIB<-NIB_e[1:14,1:2]
NICA<-NICA_e[1:14,1:2]
BOKL<-BOKL_e[1:14,1:2]
NMB<-NMB_e[1:14,1:2]
PCBL<-PCBL_e[1:14,1:2]
PRVU<-PRVU_e[1:14,1:2]
SANIMA<-SANIMA_e[1:14,1:2]
SBI<-SBI_e[1:14,1:2]
SBL<-SBL_e[1:14,1:2]
SCB<-SCB_e[1:14,1:2]
SRBL<-SRBL_e[1:14,1:2]
CZBIL<-CZBIL_e[1:14,1:2]
EBL<-EBL_e[1:14,1:2]
names(GBIME) <- c("v","GBIME")
names(HBL) <- c("v","HBL")
names(KBL) <- c("v","KBL")
names(LBL) <- c("v","LBL")
names(ADBL) <- c("v","ADBL")
names(MBL) <- c("v","MBL")
names(MEGA) <- c("v","MEGA")
names(CBL) <- c("v","CBL")
names(NABIL) <- c("v","NABIL")
names(NBB) <- c("v","NBB")
names(NBL) <- c("v","NBL")
names(NCCB) <- c("v","NCCB")
names(CCBL) <- c("v","CCBL")
names(NIB) <- c("v","NIB")
names(NICA) <- c("v","NICA")
names(BOKL) <- c("v","BOKL")
names(NMB) <- c("v","NMB")
names(PCBL) <- c("v","PCBL")
names(PRVU) <- c("v","PRVU")
names(SANIMA) <- c("v","SANIMA")
names(SBI) <- c("v","SBI")
names(SBL) <- c("v","SBL")
names(SCB) <- c("v","SCB")
names(SRBL) <- c("v","SRBL")
names(CZBIL) <- c("v","CZBIL")
names(EBL) <- c("v","EBL")
all <- GBIME %>% inner_join(HBL, by="v") %>%
inner_join(KBL,by="v") %>%
inner_join(LBL,by="v") %>%
inner_join(ADBL,by="v") %>%
inner_join(MBL,by="v") %>%
inner_join(MEGA,by="v") %>%
inner_join(CBL,by="v") %>%
inner_join(NABIL,by="v") %>%
inner_join(NBB,by="v") %>%
inner_join(NBL,by="v") %>%
inner_join(NCCB,by="v") %>%
inner_join(CCBL,by="v") %>%
inner_join(NIB,by="v") %>%
inner_join(NICA,by="v") %>%
inner_join(BOKL,by="v") %>%
inner_join(NMB,by="v") %>%
inner_join(PCBL,by="v") %>%
inner_join(PRVU,by="v") %>%
inner_join(SANIMA,by="v") %>%
inner_join(SBI,by="v") %>%
inner_join(SBL,by="v") %>%
inner_join(SCB,by="v") %>%
inner_join(SRBL,by="v") %>%
inner_join(CZBIL,by="v") %>%
inner_join(EBL,by="v")
library(writexl)
## Warning: package 'writexl' was built under R version 4.0.5
write_xlsx(all, "C:/Users/Dell/Desktop/NEPSE/merol.xlsx")
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.