Вопрос

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?

Это было полезно?

Решение

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.

Другие советы

Where is the content? You can use LOAD DATA INFILE syntax, or import from a CSV file, or write a script in Java or C++ or C# to parse the file(s) holding the data and populate the database via INSERT statements. You could hire and intern and make him/her type it all up. If you don't have it in a file, you could write a web-spider to go and get crap from Google and stuff it into the database.

But I can't help you until you tell me where the data is.

Ok, I know I'm late but I created an application to (create and/or) auto-populate tables. Below is a short demonstration but check it out here if you want. enter image description here

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top