Basics
Let’s look at a few basic selectors and their results when applied to a markup example. <html> <body> <div id="nav"> <ul class="horizontal"> <li><a href="/home">Home</a></li> <li><a href="/about-us">About Us</a></li> <li><a href="/contact-us">Contact Us</a></li> </ul> <img src="/img/ad1.jpg" alt="Advertisement #1"> <img src="/img/ad2.jpg" alt="Advertisement #2"> </div> </body> </html>
Here are the XPath equivalents along side their respective CSS counterparts. Aside from the .class selector, the XPath expressions are not significantly longer or more complex.
© CSS Selector Libraries — Web Scraping >>> Back to TABLE OF CONTENTS <<< | |||||||||||||||||||
Views: 350 | |
Total comments: 0 | |