{"id":71291,"date":"2020-01-09T17:26:29","date_gmt":"2020-01-09T11:56:29","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?p=71291"},"modified":"2024-04-12T14:13:23","modified_gmt":"2024-04-12T08:43:23","slug":"xpath-css-and-selectors","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/","title":{"rendered":"XPath CSS and selectors"},"content":{"rendered":"<h1><strong>Learning XPath, CSS and selectors<\/strong><\/h1>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-78015 size-full\" src=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png\" alt=\"XPath, CSS and selectors\" width=\"626\" height=\"319\" srcset=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png 626w, https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb-300x153.png 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/a><\/p>\n<p>Let&#8217;s start with XPath CSS and selectors. The Document Object Model (DOM) is a tree-like &#8220;in memory&#8221; structure, which browsers construct when parsing an HTML page and processing JavaScript that exists either inline in the page or loaded via script tags.<\/p>\n<p>Cascading Style Sheets (CSS) is a style sheet language useful for describing the look and formatting of a document written in HTML or XML. Moreover, CSS Selectors are patterns used to select the styled element(s).<br \/>\nWhereas, XPath, the XML path language. It is a query language for selecting nodes from an XML document. Further, this helps in locating the elements with XPath works very well with a lot of flexibility. Not to mention, XPath uses path expressions to navigate through elements and attributes in an XML document.<\/p>\n<p>Above all, CSS selectors and XPath queries allow us to search this structure to find content and Capybara is wholly reliant on such selectors to be able to locate content within web pages.<\/p>\n<p>For example, finding an element whose id attribute has the value &#8216;main&#8217;<\/p>\n<p>XPath: \/\/*[@id=&#8217;main&#8217;]\n<p>CSS: #main<\/p>\n<p>Finding a direct or indirect child of any &lt;div&gt; element with the class &#8216;container&#8217;<\/p>\n<p>XPath: \/\/div\/\/*[@class=&#8217;container&#8217;]\n<p>CSS: div .container<\/p>\n<p><strong>Make your resume stand out and become a Certified Capybara Testing Professional. <a href=\"https:\/\/www.vskills.in\/practice\/index.php?route=test\/search&amp;search=capybara\">Try free practice tests here!<\/a><\/strong><\/p>\n<p><strong>A great career is just a certification away. So, practice and validate your skills to become <a href=\"https:\/\/www.vskills.in\/certification\/testing\/capybara-testing-certification\">Certified Capybara Testing Professional<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learning XPath, CSS and selectors Let&#8217;s start with XPath CSS and selectors. The Document Object Model (DOM) is a tree-like &#8220;in memory&#8221; structure, which browsers construct when parsing an HTML page and processing JavaScript that exists either inline in the page or loaded via script tags. Cascading Style Sheets (CSS) is a style sheet language&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[1],"tags":[8255,4553],"class_list":["post-71291","page","type-page","status-publish","hentry","category-uncategorized","tag-css-and-selectors","tag-xpath"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>XPath CSS and selectors - Vskills Tutorial<\/title>\n<meta name=\"description\" content=\"Enhance and Upgrade your XPath CSS and selectors skills for better career opportunities. Become a Certified Capybara Testing Professional Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"XPath CSS and selectors - Vskills Tutorial\" \/>\n<meta property=\"og:description\" content=\"Enhance and Upgrade your XPath CSS and selectors skills for better career opportunities. Become a Certified Capybara Testing Professional Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:43:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/\",\"name\":\"XPath CSS and selectors - Vskills Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png\",\"datePublished\":\"2020-01-09T11:56:29+00:00\",\"dateModified\":\"2024-04-12T08:43:23+00:00\",\"description\":\"Enhance and Upgrade your XPath CSS and selectors skills for better career opportunities. Become a Certified Capybara Testing Professional Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#primaryimage\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"XPath CSS and selectors\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XPath CSS and selectors - Vskills Tutorial","description":"Enhance and Upgrade your XPath CSS and selectors skills for better career opportunities. Become a Certified Capybara Testing Professional Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/","og_locale":"en_US","og_type":"article","og_title":"XPath CSS and selectors - Vskills Tutorial","og_description":"Enhance and Upgrade your XPath CSS and selectors skills for better career opportunities. Become a Certified Capybara Testing Professional Now!","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:43:23+00:00","og_image":[{"url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/","name":"XPath CSS and selectors - Vskills Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#primaryimage"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#primaryimage"},"thumbnailUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png","datePublished":"2020-01-09T11:56:29+00:00","dateModified":"2024-04-12T08:43:23+00:00","description":"Enhance and Upgrade your XPath CSS and selectors skills for better career opportunities. Become a Certified Capybara Testing Professional Now!","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#primaryimage","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2020\/01\/cvb.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/xpath-css-and-selectors\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"XPath CSS and selectors"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/71291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=71291"}],"version-history":[{"count":6,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/71291\/revisions"}],"predecessor-version":[{"id":78019,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/71291\/revisions\/78019"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=71291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=71291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=71291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}