O'Reilly logo

Learning Python Web Penetration Testing by Christian Martorella

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Starting with Scrapy

First, we need to define what we want to accomplish. In this case, we want to create a crawler that will extract all the book titles from https://www.packtpub.com/. In order to do so, we need to analyze our target. If we go to the https://www.packtpub.com/ website and right-click on a book title and select Inspect, we will see the source code of that element. We can see, in this case, that the book title has this format:

Creating a crawler for extracting all the book titles

Here, we can see div with a class of book-block-title, and then the title name. Keep this in mind or in a notebook, as that would be even better. We ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required