
What we need is just the number 22 to mean that we have 22 copies available.

You use get_attribute(class) to access such an information. This book is rated 4-star but this fact is hidden as a value to the class attribute.
#Webscraper checkbox code
Line 16 through 18 - We are moving down the the HTML code to get the URL for the book.Lets go through some lines so that you understand what the code is actually doing In fact all books in all pages belong to the same class product_prod and with article tag.to get into href we need to move down the hierarchy as follows: class= “product_prod” > h3 tag > a tag and the get value of href attribute. What we need in this card is to get the URL, that is, href in a tag.The tag as a class attribute with the value product_prod The book in question is inside article tag.£38.16 In stock Add to basket īefore we go into coding lets make some observations On inspecting the site here is the HTML code for the highlighted region (representing one book) The Nameless City (The. The following link also works for page 1 : Ĭlearly, we can notice a pattern implying that looping through the pages will be simple because we can generate these URL as we move along the loop.įig 5 : Inspection of elements for one book.


The details of each book can be found by using the URL on each card.
