Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

394
Views
Elemento de desplazamiento a la vista usando javascrpit en RSelenium

tengo la pagina siguiente

https://en.wikipedia.org/wiki/R_(lenguaje_de_programación)

Quiero desplazarme hasta el encabezado Hitos para que sea visible en el navegador,

Mi código,

 library(RSelenium) driver = rsDriver(browser = c("firefox")) remDr <- driver[["client"]] url = 'https://en.wikipedia.org/wiki/R_(programming_language)' remDr$navigate(url)

Yo sé eso,

 webElem <- remDr$findElement("css", "html") webElem$sendKeysToElement(list(key="end"))

y

 remDr$executeScript("window.scrollTo(0,document.body.scrollHeight);")

me lleva al final de la página.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Podemos desplazarnos usando java script para ver el elemento ( Hito ) por,

 #navigate to webpage url = 'https://en.wikipedia.org/wiki/R_(programming_language)' remDr$navigate(url)

Identificar el elemento,

 ele = remDr$findElement(using = "xpath",'//*[@id="Milestones"]') #scroll into view remDr$executeScript("arguments[0].scrollIntoView(true);", list(ele))

ingrese la descripción de la imagen aquí

Información adicional,

Para desplazarnos a la mitad de la página podemos usar,

 remDr$executeScript("window.scrollTo(0,document.body.scrollHeight/2);")
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!