Manage Server with Scripts
Overview
In order to invoke screen-scraper from something like a Visual Basic application or a PHP script screen-scraper needs to be run in server mode. When running screen-scraper in server mode it acts, in many respects, like a database server would. Interacting with screen-scraper via one of the remote scraping sessions is more or less analogous to querying a database via a database driver. Objects like scrapeable files and scripts set up in screen-scraper provide access to information much like tables and columns in a database would. Issuing a SQL query to a database is analogous to setting session variables and telling screen-scraper to initiate a named scraping session.
Log Files
When running as a server any error messages screen-scraper produces will be written to the error.log file, found in the log folder of screen-scraper's install directory.
Each time you run a scraping session externally screen-scraper will generate a log file corresponding to that scraping session in the log folder found inside screen-scraper's install directory. This can be invaluable for debugging, so you'll want to take a look at it if you run into trouble.
You can turn server logging off by unchecking the Generate log files check box in the Servers section of the settings dialog box. Within a scraping session script, the name of the log file can be found in the session variable SS_LOG_FILE_NAME.
Connecting to Server
Once the server is running it will be listening for connections. The default port the server will listen on is 8778, which can be changed by altering the Port in the Servers section of the settings dialog box.
While the server is running scraping sessions and scripts can be imported into screen-scraper without stopping it. See the documentation on importing and exporting objects for more information.
If you are experiencing trouble trying to connect to screen-scraper you will want to check the connection restrictions.
- Printer-friendly version
- Login or register to post comments