IniziaInizia gratis

Divvy Up This Exercise

We have pre-loaded an HTML into the string variable html. In this two part problem you will use this html variable as the HTML document to set up a Selector object with, and create a SelectorList which selects all div elements; then, you will check your understanding of what happens within the SelectorList.

Questo esercizio fa parte del corso

Web Scraping in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

from scrapy import Selector

# Create a Selector selecting html as the HTML document
sel = Selector( ____ )

# Create a SelectorList of all div elements in the HTML document
divs = sel.xpath( ____ )
Modifica ed esegui il codice