Question: Scape content of http://books.toscrape.com (http://books.toscrape.com) Write a function getData() to scrape title (see (1) in Figure), rating (see (2) in Figure), price (see (3) in

Scape content of http://books.toscrape.com (http://books.toscrape.com)

Write a function getData() to scrape title (see (1) in Figure), rating (see (2) in Figure), price (see (3) in Figure) of all books (i.e. 20 books) listed in the page.

For example, the figure shows one book and the corresponding html code. You need to scrape the highlighted content.

For star ratings, you can simply scrape One, Two, Three, ...

The highlighted content in the figure should be saved into a tuple ('A Light in the

...','Three','51.77')

The output is a list of 20 tuples, e.g. [('A Light in the ...','Three','51.77'), ...]. Each tuple corresponds to one book

Scape content of http://books.toscrape.com (http://books.toscrape.com) Write a function getData() to scrape title

A Light n the Attic (2), but get only text from three :DeTore (1) A Light in the .

  • article class-"product-pod"> div class="image-con /div> 251.77

    2) href="catalogue/a-light-in-the-attic-1000/ index.html" title="A Light in the Attic" Light in the /a> = $0 a /h3>

    A Light n the Attic (2), but get only text from three :DeTore (1) A Light in the .
  • article class-"product-pod"> div class="image-con /div> 251.77

    2) href="catalogue/a-light-in-the-attic-1000/ index.html" title="A Light in the Attic" Light in the /a> = $0 a /h3>

  • Step by Step Solution

    There are 3 Steps involved in it

    1 Expert Approved Answer
    Step: 1 Unlock blur-text-image
    Question Has Been Solved by an Expert!

    Get step-by-step solutions from verified subject matter experts

    Step: 2 Unlock
    Step: 3 Unlock

    Students Have Also Explored These Related Databases Questions!