screen-scraper logo The web data extraction experts Search
Navigation See our products Contact us Buy screen-scraper professional Help and support Download screen-scraper Free quote Navigation
Table of Contents

Importing and exporting objects

Overview

Scraping sessions and scripts can be exported from screen-scraper to external files. You might consider doing this in order to back up your work, but the principle purpose is to allow for examples to be exported in order to help others learn how to use screen-scraper.

Exporting Objects from screen-scraper

In order to export a scraping session or script to an external file simply select the object you wish to export then click on the corresponding "Export" button. You'll be asked to save the file to a location of your choice. You're also free to name the file what you wish, though we recommend you leave the "(scraping session)" or "(script)" portion of the name in tact so that you can identify the type of the object later on. When you export a scraping session from screen-scraper all scripts directly associated with that scraping session will be exported within the same file.

Note that when exporting a scraping session all scripts referenced from that scraping session will be exported along with it. This does not include, however, scripts used to invoke the scraping session.

Importing Objects into screen-scraper

To import a scraping session or script into screen-scraper select the "Import..." option from the "File" menu. Locate the XML file corresponding to the object you wish to import, and select "Open". If you've selected a valid file the objects contained within that file will be imported into the application.

You can also import exported scraping sessions and scripts into screen-scraper by copying them into the "import" folder you'll find in the directory where screen-scraper was installed. This can be especially useful while screen-scraper is running as a server, which allows the objects to be imported on the fly (that is, without stopping the server). screen-scraper will check this directory just before executing a scraping session, and import any files found in it. Note that imported files will be removed from the import folder once they are imported by screen-scraper.

In cases where you want to pack up scraping sessions and scripts along with other files needed to run a scrape, you can compress them all into an "update.zip" file. This file should replicate the directory structure of screen-scraper. For example, you might have a folder called "import" that contains a scraping session. You might also have a CSV file in the root of the zip file that contains parameters needed to run the scraping session. You can zip all of these up into an "update.zip" file, then place that file inside an "update" folder found in screen-scraper's folder. When screen-scraper starts up it will unzip the file, copy all of its contents to the corresponding locations, then delete the "update.zip" file.


From here:

© 2002-2008 copyright e-kiwi, LLC
about us | blog | contact us | legal