r - 使用 RSelenium 在网页上查找元素的问题
问题描述
我一直在尝试使用 R 软件中的 remDrv $ findElements 在网页上获取元素“Excel CSV”,但未能实现。如何使用 xpath、css 等参数调用元素?
我尝试:
library(RSelenium)
test_link="https://sinca.mma.gob.cl/cgi-bin/APUB-MMA/apub.htmlindico2.cgi?page=pageFrame&header=Talagante¯opath=./RM/D28/Cal/PM25¯o=PM25.horario.horario&from=080522&to=210909&"
rD <- rsDriver(port=4446L, browser = "firefox", chromever = "92.0.4515.107") # runs a chrome browser, wait for necessary files to download
remDrv <- rD$client
#remDrv$open(silent = TRUE)
url<-test_link
remDrv$navigate(url)
remDrv$findElements(using = "xpath", "/html/body/table/tbody/tr/td/table[2]/tbody/tr[1]/td/label/span[3]/a")
解决方案
推荐阅读
- java - 在 CompletableFuture 中使用 thenXXXX 与 thenXXXXAsync 方法的性能影响
- javascript - Vega 可视化 - 如何在使用 vega 视图时启用操作
- windows - 在 Windows 2012 R2 上禁用 RC4 kerberos 加密类型
- python - 命名文件输出moviepy ffmpeg
- javascript - 和
- css - 在 RShiny 中制作传单地图全屏
- javascript - “响应”类型上不存在属性“数据”
- django - Django ORM - 通过表加入多对多
- angular - 无法读取未定义的属性“服务”
- android - 某些设备不显示工具栏后退箭头 + 搜索视图图标