There are many classes that can be very helpful in getting your scripts to run correctly. Many of these are initially developed in-house to speed up coding time and once they have proved very stable offered to the public. For all classes you will need to import their packages. They are not automatically imported like the built-in screen-scraper objects.
The Apache Lang library provides enhancements to the standard Lang library of Java and can be particularly useful for completing tasks. As it is not a class that we maintain we will not document the methods in case they change without our notice but we invite you to look over how to use it in their API.
The CSVReader is not a class that is part of screen-scraper but is very useful and well put together. We have used it extensively. It is part of the opencsv package which actually holds the under pinnings of our own CsvWriter. As it is not a class that we maintain we will not document the methods in case they change without our notice but we invite you to look over how to use it in their API or brief documentation.
To use the CSVReader simply import it in your script, the same as you would any other utility class. The opencsv.jar file is already included in the Professional and Enterprise Editions of screen-scraper's default installation.
This CsvWriter has been created to work particularly well with the screen-scraper objects. It is simple to use and provided to ease the task of keeping track of everything when creating a csv file.
The most used methods are documented here but if you would like more information you can read the JavaDoc for the CsvWriter.
Create a csv file writer.
Returns a CsvWriter object. If it encounters an error it will be thrown.
Version | Description |
---|---|
5.0 | Available for Professional and Enterprise editions. |
4.5.18a | Introduced in alpha version. |
com.screenscraper.csv.CsvWriter
Clear the buffer contents and close the file.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
5.0 | Available for all editions. |
4.5.18a | Introduced in alpha version. |
Write the buffer contents to the file.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
5.0 | Available for all editions. |
4.5.18a | Introduced in alpha version. |
Set the header row of the csv document. If the document already exists the headers will not be written. Also creates a data record mapping to ease writing to file.
Returns void.
Version | Description |
---|---|
5.0 | Available for all editions. |
4.5.18a | Introduced in alpha version. |
If you want to use the data record mapping then the extractor tokens names should be all caps and all spaces should be replaced with underscores.
Write to the CsvWriter object.
Returns void.
Version | Description |
---|---|
5.0 | Available for all editions. |
4.5.18a | Introduced in alpha version. |
This class is used to instantiate a data manager object. This is done to simplify the process of creating a data manager of a given type. Currently it only creates SqlDataManagers. A SQL data manager can be created without the use of this class, but it is simplified greatly through its use.
This class should no longer be used. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples
This class is only available for Professional and Enterprise editions of screen-scraper.
This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.
Create a MsSQL data manager object.
Returns a SqlDataManager object. If an error is experienced it will be thrown.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
In order to create the MsSQL data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the MsSQL JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.
This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.
Create a MySQL data manager object.
Returns a SqlDataManager object. If an error is experienced it will be thrown.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
In order to create the MySQL data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the MySQL JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.
This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.
Create an Oracle data manager object.
Returns a SqlDataManager object. If an error is experienced it will be thrown.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
In order to create the Oracle data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the Oracle JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.
This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.
Create a Postgre data manager object.
Returns a SqlDataManager object. If an error is experienced it will be thrown.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
In order to create the Postgre data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the Postgre JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.
This method is no longer supported. Use a java.sql.BasicDataSource or com.screenscraper.datamanager.SshDataSource instead. See the SqlDataManager.buildSchemas page for examples.
Create a SQLite data manager object.
Returns a SqlDataManager object. If an error is experienced it will be thrown.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
In order to create the Sqlite data manager you will need to make sure to install the appropriate jdbc driver. This can be done by downloading the Sqlite JDBC driver and placing it in the lib/ext folder in the screen-scraper installation directory.
The proxy server pool object is used to aid with manual anonymization of scrapes. An example of how to setup manual proxy pools is available in the documentation. You will likely want to read that page first if you are new to the process.
Additionally, you should reference the available method's available in the Anonymous API
Initiate a ProxyServerPool object.
This method does not receive any parameters.
Returns a ProxyServerPool.
Version | Description |
---|---|
4.5 | Available for all editions. |
com.screenscraper.util.ProxyServerPool
Set the timeout that will render a proxy as being bad.
Returns void.
Version | Description |
---|---|
4.5 | Available for all editions. |
Retrieve the number of available proxy servers.
This method does not receive any parameters.
Returns the number of available proxy servers, as an integer.
Version | Description |
---|---|
4.5 | Available for all editions. |
Write list of proxies to log.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
4.5 | Available for all editions. |
Add proxy servers to pool using a text file.
Returns void.
Version | Description |
---|---|
4.5 | Available for all editions. |
Enables or disables automatic proxy cycling. When this is set to false (default is true) the current proxy that was automatically selected from the pool will be used each time the next proxy is requested. When set to true, each call to the getNextProxy method will cycle as normal between all available proxies.
A boolean value.
None
Version | Description |
---|---|
5.5.17a | Available in Professional and Enterprise editions. |
Set the number of proxies that can be tested concurrently.
Returns void.
Version | Description |
---|---|
4.5 | Available for all editions. |
Set threshold to get more proxy servers.
Returns void.
Version | Description |
---|---|
4.5 | Available for all editions. |
Write list of proxies after invalid proxies have been removed.
Returns void.
Version | Description |
---|---|
4.5 | Available for all editions. |
Retry Policies are objects that tell a scrapeable file how to check for errors, and optionally what to do before retrying to download the files. Some of the things that can be done are executing scripts when the page loads incorrectly or running Runnables. Usually these things would either request a new proxy, output some helpful information, or could simply stop the scrape. RetryPolicy is an interface and can be implemented to create a custom retry policy, or there is a RetryPolicyFactory class that can be used to create some standard policies.
This policy is checked AFTER all the extractors have been run. This allows for checks on whether extractor patterns matched or not, and also allows a page to have it's 'error status' based off of another page (since extractor patterns could execute scripts that scrape other files, and those files could set a variable that acts as a flag to a previous retry policy). This could also cause some problems if the scrape isn't built to handle a page whose extractors shouldn't be run before the error checking occurs.
This interface is in the com.screenscraper.util.retry
package.
If you need a custom retry policy, you can implement your own version of it. Be aware that you will need to ensure the references it has to the scrapeableFile are to the correct scrapeableFile. This could be tricky if you use the session.setDefaultRetryPolicy method. When using the scrapeableFile.setRetryPolicy method, the scrapeableFile will be the correct object. The interface is given below.
To help ensure you can create custom retry policies that have access to the scraping session and the scrapeable file that is currently being checked, there is an AbstractRetryPolicy class in the same package as the interface. This class defines some default behavior and adds protected fields for the session and scrapeable file that get set before the policy is run. If you extend this abstract class you can access the session and scrapeable file through this.scrapingSession and this.theScrapeableFile. Due to some oddities with the interpreter it is best to reference these variables with 'this.' to eliminate a few problems that arise in a few specific cases.
Returns a map that can be used to output an error message to indicate what checks failed. For instance, you could set a key to the value "Status Code" and the value '200', or a key with "Valid Page" and value 'false'
This method takes no parameters
Map of keys, or null if no values are indicated
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Return the maximum number of times this policy allows for a retry before terminating in an error
This method takes no parameters
The maximum number of times to allow the ScrapeableFile to be rescraped before resulting in an error
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Checks to see if the page loaded incorrectly
This method takes no parameters
True on errors, false otherwise
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Returns true if the referrer should be reset before attempting to rescrape the file, if there was an error. This can be useful to reset so the referrer doesn't show the page you just requested.
This method takes no parameters
True if the referrer should be reset if there was an error, false otherwise.
Version | Description |
---|---|
6.0.36a | Available in all editions. |
Returns true if the session variables should be reset before attempting to rescrape the file, if there was an error. This can be useful especially if extractors null session variables when they don't match, but the value is needed to rescrape the file.
This method takes no parameters
True if session variables should be reset if there was an error, false otherwise.
Version | Description |
---|---|
5.5.29a | Available in all editions. |
This will be called if all the retry attempts for the scrapeable file failed. In other words, if the policy said to retry 25 times, after 25 failures this method will be called. Note that runOnError will be called just before this, as it is called after each time the scrapeable file fails to load correctly, including the last time it fails to load.
This should only contain code that handles the final error. Any proxy rotating, cookie clearing, etc... should generally be done in the runOnError method, especially since it will still be called after the final error.This method takes no parameters
This method returns void
Version | Description |
---|---|
6.0.37a | Available in all editions. |
Runs this code when the page had an error. This could include things such as rotating the proxy. This code will be executed just before the page is downloaded again.
This method takes no parameters
This method returns void
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Returns true if errors should be logged to the log/web interface when they occur
This method takes no parameters
True if errors should be logged to the log/web interface when they occur
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Class used to create simple Retry Policies. See the RetryPolicy page for more details on what a RetryPolicy does. This class is found in the com.screenscraper.util.retry
package.
Policy that retries if there was an error on the request by status code. Executes the runnable given before retrying.
The RetryPolicy to set in the ScrapeableFile
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Policy that returns no error. Useful for having a session-wide retry policy, but then using this for a particular scrapeable file so it doesn't use the session's policy
The RetryPolicy to set in the ScrapeableFile
Version | Description |
---|---|
6.0.25a | Available in all editions. |
Policy that requires a Regular Expression to match the page content (including headers) in order to be considered valid.
The RetryPolicy to set in the ScrapeableFile
Version | Description |
---|---|
5.5.29a | Available in all editions. |
Policy that requires a Regular Expression NOT to match the page content (including headers) in order to be considered valid. In other words, if the Regular Expression matches, it means that the page should be rescraped.
The RetryPolicy to set in the ScrapeableFile
Version | Description |
---|---|
5.5.29a | Available in all editions. |
This object simplifies your interactions with a JDBC-compliant SQL database. It can work with various types of databases and even in a multi-threaded format to allow scrapes to continue without having to wait for the queries to process. View an example of how to use the SqlDataManager.
This feature is only available for Professional and Enterprise editions of screen-scraper.
Prefer a more traditional approach? See an example of Working with MySQL databases.
In order to use the SqlDataManager you will need to make sure to install the appropriate JDBC driver. This can be done by downloading the driver and placing it in the lib/ext folder in the screen-scraper installation directory.
Add an event callback to SqlDataManager object.
This feature is only available for Professional and Enterprise editions of screen-scraper.
Before adding an event to the SqlDataManager, you must build the schema of any tables you will use because events are related to table operations such as inserting data
public void handleEvent(DataManagerEvent event)
that needs to be implemented. The DataManagerEvent has a method getDataNode() to retrieve the relevant DataNode.Returns a DataManagerEventListener. The same DataManagerEventListener object that was passed in
Version | Description |
---|---|
5.5 | Available for professional and enterprise editions. |
Add data to fields, in preparation for insertion into a database.
When adding data in a many-to-many relation, if setAutoManyToMany is set to false, a null row should be inserted into the relating table so the datamanager will link the keys correctly between related tables. For example, dm.addData("many_to_many", null);
Before adding data the first time, you must build the schema of any tables you will use, as well as add foreign keys if you are not using a database engine that natively supports them (such as InnoDB for MySQL).
The SqlDataManager will attempt to convert a value that is given to the correct format for the database. For example, if the database requires an int for a column named age, dm.addData("table", "age", "32") will convert the String "32" to an int before adding it to the database. See the table below the examples for other types of java objects and how they map to SQL types.
The table and columnName parameters are not case sensitive. The same is true for the key values in the data map.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Since the DataManager is designed with screen-scraper in mind all inputs support using the String type in addition to their corresponding Java object type, but the String needs to be parseable into the corresponding data type. For example if there is a column that is defined as an Integer in the database then the String needs to be parseable by Integer.parseInt(String value). Here is a mapping of the sql types (based on java.sql.Types) to Java objects:
SQL Type | Java Object | |
---|---|---|
java.sql.Types.CHAR | String | |
java.sql.Types.VARCHAR | String | |
java.sql.Types.LONGVARCHAR | String | |
java.sql.Types.LONGNVARCHAR | String | |
java.sql.Types.NUMERIC | BigDecimal | |
java.sql.Types.DECIMAL | BigDecimal | |
java.sql.Types.TINYINT | Integer | |
java.sql.Types.SMALLINT | Integer | |
java.sql.Types.INTEGER | Integer | |
java.sql.Types.BIGINT | Long | |
java.sql.Types.REAL | Float | |
java.sql.Types.FLOAT | Double | |
java.sql.Types.DOUBLE | Double | |
java.sql.Types.BIT | Boolean | |
java.sql.Types.BINARY | ByteArray | |
java.sql.Types.VARBINARY | ByteArray | |
java.sql.Types.LONGVARBINARY | ByteArray | |
java.sql.Types.DATE | SQLDate or Long | |
java.sql.Types.TIME | SQLTime or Long | |
java.sql.Types.TIMESTAMP | SQLTime or Long | |
java.sql.Types.ARRAY | Object | |
java.sql.Types.BLOB | ByteArray | |
java.sql.Types.CLOB | Object | |
java.sql.Types.JAVA_OBJECT | Object | |
java.sql.Types.OTHER | Object |
Manually setup table connection (key matching).
If SqlDataManager.buildSchemas is called, any foreign keys manually added before that point will be overridden or erased.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
If the database has some indication of foreign keys then these will be followed automatically. If the database does not allow for foreign key references then you will need to build the table connections using this method.
Manually add session variable data to fields, in preparation for insertion into a database.
The keys from the session will be matched in a case insensitive way to the column names of the database.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Add corresponding session variables to the tables automatically when it is committed.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Collect the database schema information, including foreign key relations between tables.
Schemas must be built for any tables that will be used by this DataManager before data can be added.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Clear all data from the data manager without writing it to the database. This includes all data previously committed but not yet written.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Clear session variables corresponding to the fields of a specific table (case insensitive).
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Clear session variables corresponding to a committed table automatically.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Close data manager's connections.
If there is data that has not yet been written to the database when this method is called it will not be written.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Commit a prepared row of data into queue. Once called the data can no longer be edited. When working with multiple tables that relate by a foreign key, it is important to commit rows in the correct order. The rows in each of the child tables should be committed before the parent, or they will not be correctly linked when written to the database.
This does not write the row of data to the database, but rather puts it in queue to be written at a later time.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Commit prepared rows of data for all tables into queue. Once called the data can no longer be edited.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Write committed data to the database. Any data that has not been committed using either the commit or commitAll method will be lost and not written to the database.
This method does not receive any parameters.
Returns true data was successfully written to the database; otherwise, it returns false.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Retrieve the connection object of the data manager. This can be helpful if you want to do something that the data manager cannot do easily, such as query the database.
Be sure to close the connection once it is no longer needed. Failure to do so could exhaust the connection pool used by the datamanger, which will cause the scraping session to hang.
This method does not receive and parameters.
Returns a connection object matching the one used in the data manager.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Retrieve the last autogenerated primary key, if any, for the given table
case insensitve table name
Returns a com.screenscraper.datamanager.DataObject containing the primary key.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Sets whether or not the data manager should automatically take care of many-to-many relationships.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
If the many-to-many table has more information than just the keys then you will want to leave this feature turned off so that you can add more data than just the keys before committing.
This feature is only available for Professional and Enterprise editions of screen-scraper.
Set global merge status. When conflicts exist in data, a merge of true will take the newer values and save them over previous null values.
When merging or updating values in a table, that table must have a Primary Key. When the Primary Key is set to autoincrement, if the value of that key was not set with the addData method the DataManager will create a new row rather than update or merge with an existing row. One solution is to use an SqlDuplicateFilter to set fields that would identify an entry as a duplicate and automatically insert the value of the autoincrement key when data is committed.
Update | Merge | Resulting Action |
---|---|---|
false | false | Ignore row on duplicate |
true | false | Update only values whose corresponding columns are currently NOT NULL in the database |
false | true | Update only values whose corresponding columns are currently NULL in the database |
true | true | Update all values to new data |
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
This feature is only available for Professional and Enterprise editions of screen-scraper.
Set update status globally. When conflicts exist in data, an update of true will take the newer values and save them over previous non-null values.
When merging or updating values in a table, that table must have a Primary Key. When the Primary Key is set to autoincrement, if the value of that key was not set with the addData method the DataManager will create a new row rather than update or merge with an existing row. One solution is to use an SqlDuplicateFilter to set fields that would identify an entry as a duplicate and automatically insert the value of the autoincrement key when data is committed.
Update | Merge | Resulting Action |
---|---|---|
false | false | Ignore row on duplicate |
true | false | Update only values whose corresponding columns are currently NOT NULL in the database |
false | true | Update only values whose corresponding columns are currently NULL in the database |
true | true | Update all values to new data |
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Set the error logging level. Currently only DEBUG and ERROR levels are supported. At the DEBUG level, all queries and results will be output to the log.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
This feature is only available for Professional and Enterprise editions of screen-scraper.
Set merge status for a table. When conflicts exists in data, a merge of true will take the newer values and save them over previous null values.
When merging or updating values in a table, that table must have a Primary Key. When the Primary Key is set to autoincrement, if the value of that key was not set with the addData method the DataManager will create a new row rather than update or merge with an existing row. One solution is to use an SqlDuplicateFilter to set fields that would identify an entry as a duplicate and automatically insert the value of the autoincrement key when data is committed.
Update | Merge | Resulting Action |
---|---|---|
false | false | Ignore row on duplicate |
true | false | Update only values whose corresponding columns are currently NOT NULL in the database |
false | true | Update only values whose corresponding columns are currently NULL in the database |
true | true | Update all values to new data |
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Set number of threads that the data manager can have open at once. When set higher than one, the scraping session can continue to run and download pages while the database is being written. This can decrease the time required to run a scrape, but also makes debugging harder as there is no guarantee about the order in which data will be written. It is recommended to leave this setting alone while developing a scrape. Also, the flush method will always return true if more than one thread is being used to write to the database, even if the write failed.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
This feature is only available for Professional and Enterprise editions of screen-scraper.
Set update status for a given table. When conflicts exists in data, an update of true will take the newer values and save them over previous non-null values.
When merging or updating values in a table, that table must have a Primary Key. When the Primary Key is set to autoincrement, if the value of that key was not set with the addData method the DataManager will create a new row rather than update or merge with an existing row. One solution is to use an SqlDuplicateFilter to set fields that would identify an entry as a duplicate and automatically insert the value of the autoincrement key when data is committed.
Update | Merge | Resulting Action |
---|---|---|
false | false | Ignore row on duplicate |
true | false | Update only values whose corresponding columns are currently NOT NULL in the database |
false | true | Update only values whose corresponding columns are currently NULL in the database |
true | true | Update all values to new data |
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Initiate a SqlDataManager object.
Before adding data to the SqlDataManager, you must build the schema of any tables you will use, as well as add foreign keys if you are not using a database engine that natively supports them (such as InnoDB for MySQL).
Returns a SqlDataManager. If an error is experienced it will be thrown.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
com.screenscraper.datamanager.sql.SqlDataManager
SqlDuplicateFilters are designed to filter duplicates when more information than just a primary key might define a duplicate entry. For example, you might define a unique person by their SSN, driver's license number, or by their first name, last name, and phone number. It is also possible that a single person may have multiple phone numbers, and if any of them match then the duplicate constraint should be met. Using an SqlDuplicateFilter can check for conditions such as this and correctly recognize duplicate entries.
This feature is only available for Professional and Enterprise editions of screen-scraper.
Sometimes the data will need to be filtered across multiple tables, or possibly different constaints might indicate a duplicate. An example of this is a person might be a duplicate if their SSN matches OR if their driver's license number matches. Alternatively, they may be a duplicate when they have the same first name, last name, and phone number.
Duplicate filters are checked in the order they are added, so consider perfomance when creating duplicate filters. If, for instance, most duplicates will match on the social security number, create that filter before the others. Also make sure to add indexes into your database on those columns that you are selecting by or else performance will rapidly degrade as your database gets large.
Duplicates will be filtered by any one of the filters created. If multiple fields must all match for an entry to be a duplicate, create a single filter and add each of those fields as constraints, as shown in the third filter created above. In other words, constraints added to a single filter will be ANDed together, while seperate filters will be ORed.
Add a constraint that checks the value of new entries against the value of entries already in the database for a given column and table.
Returns void.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Sometimes the data will need to be filtered across multiple tables, or possibly different constaints might indicate a duplicate. An example of this is a person might be a duplicate if their SSN matches OR if their driver's license number matches. Alternatively, they may be a duplicate when they have the same first name, last name, and phone number.
Duplicate filters are checked in the order they are added, so consider perfomance when creating duplicate filters. If, for instance, most duplicates will match on the social security number, create that filter before the others. Also make sure to add indexes into your database on those columns that you are selecting by or else performance will rapidly degrade as your database gets large.
Duplicates will be filtered by any one of the filters created. If multiple fields must all match for an entry to be a duplicate, create a single filter and add each of those fields as constraints, as shown in the third filter created above. In other words, constraints added to a single filter will be ANDed together, while seperate filters will be ORed.
Create an SqlDuplicateFilter for a specific table and register it with the data manager.
Returns an SqlDuplicateFilter that can then be configured for duplicate entries.
Version | Description |
---|---|
5.0 | Available for professional and enterprise editions. |
Oftentimes you want to write extracted data directly to an XML file. This class facilitates doing that. Before working with the methods below, you may wish to read our documentation about writing extracted data to XML, which contains examples of scripts that utilize these methods.
This feature is only available to Enterprise editions of screen-scraper.
Initiate a XmlWriter object.
Returns a XmlWriter. If an error is experienced it will be thrown.
Version | Description |
---|---|
4.5 | Available for enterprise edition. |
5.5.3a | Added the constructor that takes a character set. |
com.screenscraper.xml.XmlWriter
Add a node to the XML file.
Returns the added element object.
Version | Description |
---|---|
4.5 | Available for enterprise edition. |
Add multiple nodes under a single node (new or already in existence).
OR
OR
Returns the main added element object, if one was created. It there was not a main element that was added then it returns void.
Version | Description |
---|---|
4.5 | Available for enterprise edition. |
Close the XmlWriter.
This method does not receive any parameters.
Returns void.
Version | Description |
---|---|
4.5 | Available for enterprise edition. |