Google Chrome Console: XPath Expressions: $x(’//h1’)

Use XPath to Select Specific DOM Elements

nick3499
1 min readMar 23, 2017

Load the http://example.com web page. In Chrome DevTools Console, enter $x('//h1') to select all h1 elements in the document. In this case, there is one.

Entering $x('/html/body/div/h1') selects the same h1 element.

--

--

nick3499
nick3499

Written by nick3499

coder of JavaScript and Python

No responses yet