博文

目前显示的是 十月, 2018的博文

RSelenium 爬取 中检院生物制品批签发信息公示表

#java -jar /usr/local/bin/selenium-server-standalone-3.9.1.jar library(RSelenium) library(rvest) library(stringr) library(magrittr) library(tidyverse) remDr <- remoteDriver(   remoteServerAddr = "localhost",   port = 4444,   browserName = "firefox") #打开浏览器 remDr$open() remDr$navigate("http://www.nifdc.org.cn/CL0903/") webElems <- remDr$findElements(using = "partial link text", "中检院生物制品批签发信息公示表") links <- unlist(lapply(webElems, function(e) {e$getElementAttribute("href")})) # 下一页 nextElem <- remDr$findElement(using = "partial link text", "下一页") a.elem <- nextElem$getElementAttribute('href')[[1]] remDr$navigate(a.elem) nextWebElems <- remDr$findElements(using = "partial link text", "中检院生物制品批签发信息公示表") links <- c(links,unlist(lapply(nextWebElems, function(e) {e$getElementAttribute("href")}))) dataframe <-data.frame() for (i in 1:length(links)) {   re

R 安装 rJava

错误提示 configure: error: Java Development Kit (JDK) is missing or not registered in RMake sure R is configured with full Java support (including JDK). 解决: sudo apt install openjdk-11-jdk sudo R CMD javareconf JAVAC=/usr/lib/jvm/java-11-openjdk-amd64/bin/javac JAR=/usr/lib/jvm/java-11-openjdk-amd64/bin/jar sudo R CMD javareconf JAVAC=/usr/lib/jvm/java-11-oracle/bin/javac JAR=/usr/lib/jvm/java-11-oracle/bin/jar JAVA_HOME=/usr/lib/jvm/java-11-oracle//bin/jar