0

I try to take the href from an element using RSelenium.

Here is an example of html structure:

<ol id="rem">
<div class="bare">
   <h3>
      <a class="tlt mhead" href="https://www.myexample.com">

I use this:

pro<-remDr$findElement(using = 'xpath', "//*/input[@class = 'bare']")
  pro$highlightElement()

but it can't find the element and returns this error:

Error:   Summary: NoSuchElement
     Detail: An element could not be located on the page using the given search parameters.
     class: org.openqa.selenium.NoSuchElementException

What can I do?

Elen
  • 39
  • 7

1 Answers1

0

Not the input element has the bare class, the div (assuming dib is a typo):

//div[@class='bare']/h3/a
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • thank you. Yes it is div and not dib. It seems very logical but unfortunately again I receive the same error. Even if I tried this `pro<-remDr$findElement(using = 'xpath', "//*/div[@class='bare']/h3/a")` which could have different syntax in RSelenium – Elen Sep 27 '16 at 06:23
  • could be a problem because there is a list in dom with this structure? So I could give the position i.e. [1] – Elen Sep 27 '16 at 06:34