Linked Questions

0 votes
1 answer
2k views

To access an element i used the following command document.getElementById('ghi').innerHTML="Replace the paragragh with this text" How to use the same functionality in javascript by using xpath As ...
Harish Naidu's user avatar
0 votes
0 answers
59 views

I need some help in JS. Basically I want to write a function in JavaScript which takes XPath of the webpage and returns the innerHTML of that Xpath. Something like this function : getXpath(my_xpath) {...
user3223322's user avatar
553 votes
33 answers
610k views

I'm working on an Extension in Chrome, and I'm wondering: how do I find out when an element comes into existence? Using plain JavaScript, with an interval that checks until an element exists, or does ...
mattsven's user avatar
  • 23.5k
20 votes
2 answers
39k views

How can I use $x() to use xpath expression inside a page.evaluate() ? As far as page is not in the same context, I tried $x() directly (like I would do in chrome dev tools), but no cigar. The ...
MevatlaveKraspek's user avatar
26 votes
2 answers
21k views

I am traversing a HTML document using javascript DOM. I want make a list (an array actually) of all nodes/elements and their values. I found a script for traversing DOM, but how do I store each node ...
Annibigi's user avatar
  • 6,045
6 votes
4 answers
22k views

I need to find any element in DOM by xpath. I already tried the following: let el = await page.$x('//*[@id="readium-right-panel"]/ul/li[1]'); The returning error is: TypeError: page.$x is not a ...
haderm94's user avatar
6 votes
1 answer
20k views

I have a very basic code. It simply changes the style of the button on click. It works fine when used getElementById but I wanna do it the XPATH way. I'm new to JavaScript. What I'm doing wrong and ...
Abhay Salvi's user avatar
  • 1,138
1 vote
5 answers
41k views

How can i get this telefoon nummer in string variable. <span itemprop="telephone" class="hidden" id="telefoon_28836_hidden">010 - 79 53 364</span> I tried this code without ant success. ...
Muratcan's user avatar
  • 235
6 votes
3 answers
11k views

I am using Python selenium to automate my attendance entry. It was working fine, now I wanted to try by modifying the source code. I have seen few posts stating that it can be modified using driver....
Jeril's user avatar
  • 8,631
5 votes
2 answers
16k views

I'm new to DOM querying and I'm wondering if it is possible to query DOM elements directly by Xpath in a similar way to the below-mentioned code? document.getElementById("searchInput"); Thanks!
user3648426's user avatar
2 votes
3 answers
24k views

I have a xpath selector xpath=//input[@id=image], I want to click on this element using the keyword Execute Javascript ,please help me right the statement I tired the statement ${Element} = Get ...
Dani's user avatar
  • 183
3 votes
3 answers
13k views

What is the difference between WebDriver and WebElement in Selenium? Sample Code: WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com"); WebElement s = driver....
Elegant Student's user avatar
4 votes
3 answers
10k views

In selenium for inputbox, we can enter value like : WebElement inputBox = driver.findElement(By.xpath(xpath))); inputBox.sendKeys("abc"); but on 1 webpage, I am having one button after clicking on ...
iRunner's user avatar
  • 1,532
2 votes
3 answers
2k views

My code is in Scala.js, but I think the gist of it should be easy to understand from a JavaScript perspective: def htmlToXHTML(input: String) (implicit parser: DOMParser, serializer: ...
bbarker's user avatar
  • 13.4k
2 votes
2 answers
6k views

As of now I am getting the count of the number of matching results using listChanges.size() . How do I directly get the count without loading getChanges in the list? By getChanges = By.xpath("//td[...
Zack's user avatar
  • 2,238

15 30 50 per page