| |
| |
| |
| cd C:\Users\53446\Desktop\try2 |
| java -Dwebdriver.chrome.driver="geckodriver.exe" -jar selenium-server-standalone-4.0.0-alpha-2.jar |
| |
| library(rvest) |
| library(RSelenium) |
| |
| remDr <- remoteDriver( |
| browserName = "firefox", # chrome、firefox |
| remoteServerAddr = "localhost", |
| port = 4444) |
| |
| remDr$open() |
| |
| |
| |
| url <- c('https://pubmed.ncbi.nlm.nih.gov/?term=%28Huang-Ge+Zhang%5BAuthor%5D%29+AND+%28University+of+Louisville%5BAffiliation%5D%29+AND+%28y_5%5BFilter%5D%29') |
| |
| |
| remDr$navigate(url) |
| remDr$getPageSource() |
| remDr$getPageSource()[[1]][1] %>% |
| read_html() |
| |
| |
| journal <- remDr$getPageSource()[[1]][1] %>% |
| read_html() %>% |
| html_nodes('.Scholarscope_Journal') %>% |
| html_text() |
| journal |
| |
| IF <- remDr$getPageSource()[[1]][1] %>% |
| read_html() %>% |
| html_nodes('.Scholarscope_Factor') %>% |
| html_text() |
| IF |
| time_up <- remDr$getPageSource()[[1]][1] %>% |
| read_html() %>% |
| html_nodes('.Scholarscope_Year') %>% |
| html_text() |
| time_up |
| title <- remDr$getPageSource()[[1]][1] %>% |
| read_html() %>% |
| html_nodes('.docsum-title') %>% |
| html_text(trim = T) |
| title |
| |
| df <- data.frame(title = title, |
| time_up = time_up, |
| journal = journal, |
| IF = IF) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| url <- c() |
| for (i in 1:3) { |
| url <- c(url,paste('https://pubmed.ncbi.nlm.nih.gov/?term=(Huang-Ge%20Zhang%5BAuthor%5D)%20AND%20(University%20of%20Louisville%5BAffiliation%5D)%20AND%20(y_5%5BFilter%5D)&page=', |
| i,sep = '')) |
| } |
| |
| |
| journal <- c() |
| IF <- c() |
| time_up <- c() |
| title <- c() |
| for(i in 1:length(url)){ |
| |
| remDr$navigate(url[i]) |
| |
| remDr$getPageSource() |
| |
| journal <- c(journal,remDr$getPageSource()[[1]][1] %>% read_html() %>% html_nodes('.Scholarscope_Journal') %>% html_text()) |
| |
| IF <- c(IF,remDr$getPageSource()[[1]][1] %>% read_html() %>% html_nodes('.Scholarscope_Factor') %>% html_text()) |
| |
| time_up <- c(time_up,remDr$getPageSource()[[1]][1] %>% read_html() %>% html_nodes('.Scholarscope_Year') %>% html_text()) |
| |
| title <- c(title,remDr$getPageSource()[[1]][1] %>% read_html() %>% html_nodes('.docsum-title') %>% html_text(trim = T)) |
| } |
| |
| df <- data.frame(title = title, |
| time_up = time_up, |
| journal = journal, |
| IF = IF) |