O'Reilly logo

Instant PHP Web Scraping by Jacob Ward

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

Saving scraped data to a database (Intermediate)

In all of the recipes so far, the results of our scrapes are simply been printed to the screen. While this is fine for small projects, where the data may only be required only one time; but if we are scraping a large amount of data, which needs to be organized and saved for future access, we will need to create a database.

Getting ready

In this recipe, we will create a database using MySQL, into which we can save our scraped data. We will then modify the previous recipe, which prints the scraped data to the screen, to access the database, and save the data.

How to do it...

  1. Start the XAMPP Control Panel.
  2. Click on the Admin button for MySQL, and phpMyAdmin will open in our web browser.
  3. Select the Users ...

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