Skip to content

CUG-Flood/curlR2.R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

curlR

R-CMD-check codecov License CRAN

Installation

1. Windows

环境配置详见:https://gitlab.com/r-pkgs/curlr.bin

remotes::install_github("rpkgs/curlR", INSTALL_opts="--no-staged-install")

Example

library(curlR)

port = 4444
kill_selenium(port)
p <- init_selenium(port)

p %>% go("https://cn.bing.com/")
getElementByName(p, "q") %>% ele_fillText("curlR", key = "enter")
# getElementByName(p, "go") %>% ele_click()

# GET ALL results
xs = ele_find_all(p, "//ol/li", "xpath")

# GET the first result
x = ele_find_first(p, "//ol/li", "xpath")
a = ele_child(x, "//a") # get link
a %>% clickElement()
# if page changed, previous node will be destroyed

selenium

Linux

sudo apt install firefox-geckodriver chromium-chromedriver 
sudo apt install chromium-browser

Reference

  1. https://extendsclass.com/xpath-to-css.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published