Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Hands-On Web Scraping with Python
  • Table Of Contents Toc
Hands-On Web Scraping with Python

Hands-On Web Scraping with Python

By : Chapagain
4 (11)
close
close
Hands-On Web Scraping with Python

Hands-On Web Scraping with Python

4 (11)
By: Chapagain

Overview of this book

Web scraping is an essential technique used in many organizations to gather valuable data from web pages. This book will enable you to delve into web scraping techniques and methodologies. The book will introduce you to the fundamental concepts of web scraping techniques and how they can be applied to multiple sets of web pages. You'll use powerful libraries from the Python ecosystem such as Scrapy, lxml, pyquery, and bs4 to carry out web scraping operations. You will then get up to speed with simple to intermediate scraping operations such as identifying information from web pages and using patterns or attributes to retrieve information. This book adopts a practical approach to web scraping concepts and tools, guiding you through a series of use cases and showing you how to use the best tools and techniques to efficiently scrape web pages. You'll even cover the use of other popular web scraping tools, such as Selenium, Regex, and web-based APIs. By the end of this book, you will have learned how to efficiently scrape the web using different techniques with Python and other popular tools.
Table of Contents (16 chapters)
close
close
Lock Free Chapter
1
Section 1: Introduction to Web Scraping
3
Section 2: Beginning Web Scraping
8
Section 3: Advanced Concepts
13
Section 4: Conclusion

HTML <form> processing

In this section, we will be handling form processing or form submission in order to search for an activity from http://toscrape.com (ViewState). ViewState is an AJAX-based filter form.

This particular form submission is performed in multiple steps with the help of AJAX (https://www.w3schools.com/js/js_ajax_intro.asp). For more information on AJAX, please visit W3Schools AJAX:

http://toscrape.com with various endpoints in the Quotes section

Let's set up the code. The pyquery and requests libraries need to be imported and the required URLs need to be collected so that they can be used. The processRequests() function, along with positional and named arguments, is used for processing requests to the provided url, with the HTTP POST and GET methods based on the params argument returning a PyQuery object as a response.

We are also interested in iterating...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Hands-On Web Scraping with Python
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon