# install.packages('RSelenium')
#java -Dwebdriver.chrome.driver="chromedriver.exe" -jar selenium-server-standalone-4.0.0-alpha-2.jar -port 4444
library(readxl)
library(RSelenium)
library(rvest)
library(xml2)
library(RS.Driver)
library(tidyverse)
names<-read_excel("names.xlsx")
url<-c()
id<-names$`GenBank Assembly ID (Accession.version)`
for (i in id) {
url <- c(url,paste('https://www.ncbi.nlm.nih.gov/assembly/',
i,sep = ''))
}
RS.OpenChrome()
name<-c()
submitter<-c()
date<-c()
for(i in 1:length(url)){
RS.open_Url(url[i])
#RS.OpenChrome(url[i])
#RS.open_Url(url_200[i])
Sys.sleep(2.5)
name <- c(name,RS.get_Text('//*[@id="summary"]/dl/dd[3]'))
submitter <- c(submitter,RS.get_Text('//*[@id="summary"]/dl/dd[6]'))
date <- c(date,RS.get_Text('//*[@id="summary"]/dl/dd[7]'))
}
total<-cbind(name,submitter,date)
暂无评论