MulaiMulai sekarang secara 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.

Latihan ini adalah bagian dari kursus

Web Scraping in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

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( ____ )
Edit dan Jalankan Kode