Book Image

Python Web Scraping Cookbook

By : Michael Heydt
Book Image

Python Web Scraping Cookbook

By: Michael Heydt

Overview of this book

Python Web Scraping Cookbook is a solution-focused book that will teach you techniques to develop high-performance scrapers and deal with crawlers, sitemaps, forms automation, Ajax-based sites, caches, and more. You'll explore a number of real-world scenarios where every part of the development/product life cycle will be fully covered. You will not only develop the skills needed to design and develop reliable performance data flows, but also deploy your codebase to AWS. If you are involved in software engineering, product development, or data mining (or are interested in building data-driven products), you will find this book useful as each recipe has a clear purpose and objective. Right from extracting data from the websites to writing a sophisticated web crawler, the book's independent recipes will be a godsend. This book covers Python libraries, requests, and BeautifulSoup. You will learn about crawling, web spidering, working with Ajax websites, paginated items, and more. You will also learn to tackle problems such as 403 errors, working with proxy, scraping images, and LXML. By the end of this book, you will be able to scrape websites more efficiently and able to deploy and operate your scraper in the cloud.
Table of Contents (13 chapters)

Geocoding an IP address

Geocoding is the process of converting an address into geographic coordinates. These addresses can be actual street addresses, which can be geocoded with various tools such as the Google maps geocoding API (https://developers.google.com/maps/documentation/geocoding/intro). IP addresses can be, and often are, geocoded by various applications to determine where computers, and their users, are located. A very common and valuable use is analyzing web server logs to determine the source of users of your website.

This is possible because an IP address does not only represent an address of the computer in terms of being able to communicate with that computer, but often can also be converted into an approximate physical location by looking it up in IP address / location databases. There are many of these databases available, all of which are maintained by various...