1. Learn
  2. /
  3. Courses
  4. /
  5. Web Scraping in Python

Connected

Exercise

The (X)Path to CSS Locators

Many people prefer using CSS Locator notation to XPath notation. As we will see later, it often makes attribute selection very easy. To help get you more comfortable going back and forth between XPath and CSS Locator strings, we give you a chance in this exercise to do some direct "translation" between the two.

Note that the exercises in this chapter may take some time to load.

Instructions 1/2

undefined XP
    1
    2
  • Assign to the variable css_locator a CSS Locator string which is equivalent to the XPath string given.