Search code examples
mysqldatabaseweb-scrapingauto-populate

Methods of populating a database with content automatically?


I want to populate a mysql database with basic 'holiday resort' content e.g. name of the resort, description, country. What methods can i use to populate it?


Solution

  • First, find the Web sites of one or more holiday companies who offer the destinations you're interested in. You're going to scrape these.

    You don't say what language you're using for the implementation, but here is how you might do it in Perl:

    1. Write a scraper using LWP::UserAgent and HTML::TreeBuilder to explore the site and extract the destination information.
    2. Use DBI with the DBD::MySQL driver to insert the data into your database.