Skip to content

Instantly share code, notes, and snippets.

@s0kil
Last active January 31, 2020 21:53
Show Gist options
  • Save s0kil/062a64caac00069bcf2cc0bc93300678 to your computer and use it in GitHub Desktop.
Save s0kil/062a64caac00069bcf2cc0bc93300678 to your computer and use it in GitHub Desktop.
HTML Querying Using CSS Selectors & UNIX Paths

HTML Querying Using CSS Selectors & UNIX Paths

Root DOM Element (<html></html>)

  • /

All Divs At Root Element

  • /div

First Div At Root Element

  • /div[0]

First Div At Root Element With Child Element That Contains id Attribute

  • /div[0]/#

First Div At Root Element With Child Element That Contains id Attribute With Value Of header

  • /div[0]/#header

Find Elements With class="box"

  • .box

Get Parents of Elements With class="box"

  • .box/..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment