public class ScrapingUtil
extends java.lang.Object
Constructor and Description |
---|
ScrapingUtil(ScrapingSession scrapingSession)
Creates a new scraping util
|
Modifier and Type | Method and Description |
---|---|
boolean |
alphabetLoopWithSubdivision(java.lang.String letters,
java.util.function.Function<java.lang.String,java.lang.Boolean> function)
Runs a subdividing search by alphabet letters, a-z (lowercase).
|
boolean |
alphabetLoopWithSubdivision(java.lang.String letters,
java.util.function.Function<java.lang.String,java.lang.Boolean> function,
boolean includeAlpha,
boolean includeDigits,
java.lang.String skipToLetters)
Runs a subdividing search by alphabet letters, a-z (lowercase).
|
boolean |
alphabetLoopWithSubdivision(java.lang.String firstLetters,
java.lang.String lastLetters,
java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Boolean> function)
Runs a subdividing search by alphabet letters, a-z (lowercase).
|
boolean |
alphabetLoopWithSubdivision(java.lang.String firstLetters,
java.lang.String lastLetters,
java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Boolean> function,
boolean includeAlpha,
boolean includeDigits,
java.lang.String skipToFirstLetters,
java.lang.String skipToLastLetters)
Runs a subdividing search by alphabet letters, a-z (lowercase).
|
XmlNode |
applyXPathExpression(java.lang.String content,
java.lang.String expression)
Applies an XPath expression to a string.
|
java.lang.String |
convertDateToString(java.util.Date date)
Converts the Date given to a string in the DEFAULT_DATE_FORMAT
|
java.lang.String |
convertDateToString(java.util.Date date,
java.lang.String format)
Converts the Date given to a string in a specified format, or in the DEFAULT_DATE_FORMAT if the format is null
|
java.lang.String |
convertFromUpperCase(java.lang.String text)
Converts things such as FIELD_NAME to Field Name
|
java.lang.String |
convertHTMLEntities(java.lang.String val)
Replaces HTML entities in a string with their non-entity equivalents.
|
java.util.Date |
convertStringToDate(java.lang.String dateString,
java.lang.String format)
Converts a date string to a Date object using the given format.
|
java.lang.String |
convertUTFWhitespace(java.lang.String input)
Replaces the UTF variants on whitespace with a regular space character
|
boolean |
dateIsWithinDays(java.util.Date date1,
java.util.Date date2,
int days)
Checks to see if one date is within a certain number of days of another
|
boolean |
equalsIgnoreCase(java.lang.String string1,
java.lang.String string2)
Compare the values of two strings independent of case.
|
java.lang.String |
extractXmlBlock(java.lang.String content,
int startingDepth)
Extracts a section of xml (roughly) by counting start and end tags.
|
java.lang.String |
formatNumber(java.lang.String number)
Returns a number formatted in such a way that it could be parsed as a Float, such as xxxxxxxxx.xxxx It attempts to figure out if the number is formatted
as European or American style, but if it cannot determine which it is, it defaults to American.
|
java.lang.String |
formatNumber(java.lang.String number,
boolean powerOfThousandConversion)
Returns a number formatted in such a way that it could be parsed as a Float, such as xxxxxxxxx.xxxx It attempts to figure out if the number is formatted
as European or American style, but if it cannot determine which it is, it defaults to American.
|
java.lang.String |
formatNumber(java.lang.String number,
int decimals,
boolean padDecimals)
Returns a number formatted in such a way that it could be parsed as a Float, such as xxxxxxxxx.xxxx It attempts to figure out if the number is formatted
as European or American style, but if it cannot determine which it is, it defaults to American.
|
java.lang.String |
formatNumber(java.lang.String number,
int decimals,
boolean padDecimals,
boolean powerOfThousandConversion)
Returns a number formatted in such a way that it could be parsed as a Float, such as xxxxxxxxx.xxxx It attempts to figure out if the number is formatted
as European or American style, but if it cannot determine which it is, it defaults to American.
|
java.lang.String |
formatUSPhoneNumber(java.lang.String number)
Converts a String to a US formatted phone number, as +1 (123) 456-7890x2.
|
java.lang.String |
formatUSZipCode(java.lang.String zip)
Formats and returns a US style zip code as 12345-6789.
|
int |
getCpuUsage()
Gets the current cpu usage.
|
java.lang.String |
getCurrentDate(java.lang.String format)
Returns the current date in a specified format, or uses the DEFAULT_DATE_FORMAT if null is given.
|
java.util.Map<java.lang.String,java.lang.Boolean> |
getDefaultTidySettings()
Get the default tidy settings, as a map
|
int |
getImageHeight(java.lang.String imagePath)
Gets the height of an image.
|
int |
getImageWidth(java.lang.String imagePath)
Gets the width of an image.
|
java.lang.String |
getInstallDir()
Gets the path to the directory where screen-scraper is installed.
|
org.json.JSONArray |
getJSONArray(org.json.JSONObject json,
java.lang.String key)
Gets a json array from a json object with a given key, or returns null if there is no such value, the input is null.
|
org.json.JSONObject |
getJSONObject(org.json.JSONObject json,
java.lang.String key)
Gets a json object from a json object with a given key, or returns null if there is no such value, the input is null, or the value is null or not a json object
|
java.lang.String |
getJSONString(org.json.JSONObject json,
java.lang.String key)
Gets a string from a json object.
|
java.lang.String |
getJSONString(org.json.JSONObject json,
java.lang.String key,
java.lang.String defaultValue)
Gets a string from a json object.
|
boolean |
getLogInternalMessages() |
int |
getMaximumMemoryAllocation()
Gets the value of the MaximumMemoryAllocation property.
|
int |
getMemoryUsage()
Gets the average memory usage.
|
java.lang.String |
getMimeType(java.lang.String path)
Gets the MIME-type for a file.
|
int |
getNumRunnableScrapingSessions()
Gets the number of scraping sessions that are queued up to be run.
|
int |
getNumRunningScrapingSessions()
Gets the number of scraping sessions that are currently being run.
|
int |
getNumRunningScrapingSessions(java.lang.String scrapingSessionName)
Gets the number of named running scraping sessions.
|
DataSet |
getOptionSet(java.lang.String options)
Gets a DataSet containing each of the elements of a <select> tag.
|
DataSet |
getOptionSet(java.lang.String options,
java.util.Collection<java.lang.String> ignoreLabels,
boolean tidyRecords)
Gets a DataSet containing each of the elements of a <select> tag.
|
DataSet |
getOptionSet(java.lang.String options,
java.lang.String ignoreLabel)
Gets a DataSet containing each of the elements of a <select> tag.
|
DataSet |
getOptionSet(java.lang.String options,
java.lang.String[] ignoreLabels,
boolean tidyRecords)
Gets a DataSet containing each of the elements of a <select> tag.
|
DataSet |
getOptionSet(java.lang.String options,
java.lang.String ignoreLabel,
boolean tidyRecords)
Gets a DataSet containing each of the elements of a <select> tag.
|
DataSet |
getRadioButtonSet(java.lang.String buttons,
java.lang.String buttonName)
Gets all the options from a radio button group.
|
DataSet |
getRadioButtonSet(java.lang.String buttons,
java.lang.String buttonName,
java.util.Collection<java.lang.String> ignoreLabels)
Gets all the options from a radio button group.
|
DataSet |
getRadioButtonSet(java.lang.String buttons,
java.lang.String buttonName,
java.util.Collection<java.lang.String> ignoreLabels,
boolean tidyRecords)
Gets all the options from a radio button group.
|
DataSet |
getRadioButtonSet(java.lang.String buttons,
java.lang.String buttonName,
java.lang.String ignoreLabel)
Gets all the options from a radio button group.
|
DataSet |
getRadioButtonSet(java.lang.String buttons,
java.lang.String buttonName,
java.lang.String[] ignoreLabels)
Gets all the options from a radio button group.
|
java.lang.String |
getRandomReferrer()
Gets a random referrer page from a list of many different search engine web sites and a few other pages
|
java.lang.String |
getRandomUserAgent()
Returns a random User Agent.
|
java.lang.String |
getRandomUserAgent(BrowserType browserType,
java.time.LocalDate newerThan,
java.time.LocalDate olderThan)
Returns a random User Agent.
|
java.lang.String |
getScreenScraperEdition()
Gets the edition of this instance.
|
java.lang.String |
getScreenScraperVersion()
Gets the version of this instance.
|
java.lang.Object |
getTimestampObject()
Returns an object whose toString method always resolves to the current timestamp.
|
boolean |
isInt(java.lang.Object string)
Indicates whether or not the given
String can be parsed as an int. |
boolean |
isNullOrEmptyString(java.lang.Object object)
Indicates whether or not an object is either null or an empty string.
|
boolean |
isPlatformLinux()
Indicates whether or not we're running on linux.
|
boolean |
isPlatformMac()
Indicates whether or not we're running on a Mac.
|
boolean |
isPlatformWindows()
Indicates whether or not we're running on Windows.
|
double |
linear(double number,
double minIn,
double maxIn,
double minOut,
double maxOut)
Performs a linear interpolation between two values and returns the result.
|
void |
makeDELETERequest(java.lang.String urlString)
Makes a DELETE request.
|
void |
makeDELETERequest(java.lang.String urlString,
java.util.Map headers)
Makes a DELETE request.
|
java.lang.String |
makeGETRequest(java.lang.String urlString)
Makes a GET request and returns the result as a string.
|
java.lang.String |
makeGETRequestNoSessionProxy(java.lang.String urlString)
Makes a GET request and returns the result as a string.
|
java.lang.String |
makeGETRequestUseSessionProxy(java.lang.String urlString)
Makes a GET request and returns the result as a string.
|
java.lang.String[][] |
makeHEADRequest(java.lang.String urlString)
Makes a HEAD request and returns the headers in a two-deminsional array.
|
void |
makePUTRequest(java.lang.String urlString)
Makes a PUT request.
|
void |
makePUTRequest(java.lang.String urlString,
java.util.Map headers)
Makes a PUT request.
|
DataRecord |
mergeDataRecords(DataRecord first,
DataRecord second,
boolean saveNonEmptyString)
Merges two data records by copying all values from the second record over values of the first record, and returning a new DataRecord with these values.
|
java.lang.String |
nullToEmptyString(java.lang.Object obj)
Turns a potentially null value into an empty string.
|
Name |
parseName(java.lang.String name)
Attempts to parse a string to a name.
|
Address |
parseUSAddress(java.lang.String address)
Attempts to parse a string to an address.
|
void |
pause(long time)
Indicates that the scraping session should pause for the given number of milliseconds.
|
void |
randomPause(long min,
long max)
Pauses for a random amount of time.
|
java.lang.String |
reformatDate(java.lang.String date,
java.lang.String dateFormatTo)
Reformat a date.
|
java.lang.String |
reformatDate(java.lang.String date,
java.lang.String dateFormatFrom,
java.lang.String dateFormatTo)
Reformats a date.
|
Address |
reorderUSAddressBestGuessFromLines(java.lang.String addressee,
java.lang.String address,
java.lang.String address2)
Attempts to reorder the addressee, address, and address2 lines using the address parser to attempt to validate each part.
|
void |
resizeImageFixHeight(java.lang.String originalFile,
java.lang.String thumbnailFile,
int newHeightSize,
boolean deleteOriginalFile)
Creates a thumbnail for an existing image.
|
void |
resizeImageFixWidth(java.lang.String originalFile,
java.lang.String thumbnailFile,
int newWidthSize,
boolean deleteOriginalFile)
Creates a thumbnail for an existing image.
|
void |
resizeImageFixWidthAndHeight(java.lang.String originalFile,
java.lang.String thumbnailFile,
int newWidthSize,
int newHeightSize,
boolean deleteOriginalFile)
Creates a thumbnail for an existing image.
|
void |
runMultipleScrapes(java.lang.String scrapeName,
java.lang.String key,
java.util.List<?> values,
int maxConcurrentScrapes)
Deprecated.
|
void |
runMultipleScrapes(java.lang.String scrapeName,
java.lang.String key,
java.util.List<?> values,
int maxConcurrentScrapes,
boolean shouldInheritFromParent)
Deprecated.
|
void |
runMultipleScrapes(java.lang.String scrapeName,
java.lang.String key,
java.lang.Object[] values,
int maxConcurrentScrapes)
Deprecated.
|
void |
runMultipleScrapes(java.lang.String scrapeName,
java.lang.String key,
java.lang.String file,
int maxConcurrentScrapes)
Deprecated.
|
<T> void |
runMultipleSessionsConcurrentlyForInput(int numToRun,
java.util.function.Function<T,java.util.List<T>> individualRunFunction,
java.util.concurrent.Callable<java.util.function.Supplier<T>> searchInputSupplierInitializer)
Runs multiple scraping sessions in parallel over the same input data.
|
<T> void |
runMultipleSessionsConcurrentlyForInput(int numToRun,
int queueSize,
java.util.function.Function<T,java.util.List<T>> processInputFunction,
java.util.concurrent.Callable<java.util.function.Supplier<T>> supplierInitializer)
Runs multiple scraping sessions in parallel over the same input data.
|
void |
sendMail(java.lang.String subject,
java.lang.String body,
java.lang.String recipients)
Sends mail to a pre-specified SMTP server.
|
void |
sendMail(java.lang.String subject,
java.lang.String body,
java.lang.String recipients,
java.lang.String attachments,
java.lang.String headers)
Sends mail to a pre-specified SMTP server.
|
void |
sendMail(java.lang.String subject,
java.lang.String body,
java.lang.String recipients,
java.lang.String contentType,
java.lang.String attachments,
java.lang.String headers)
Sends mail to a pre-specified SMTP server.
|
void |
setLogInternalMessages(boolean shouldLog) |
void |
setupAutoIncrementParentScrapeRecordsFromChild(ScrapingSession parent)
Sets up events to automatically increment the records for a parent scrape when the current scrape changes records count.
|
<T> java.util.List<T> |
sortSet(java.util.Set<T> set)
Sorts the elements in a set into an ordered list
|
<T> java.util.List<T> |
sortSet(java.util.Set<T> set,
boolean ignoreCase)
Sorts the elements in a set into an ordered list
|
<T> java.util.List<T> |
sortSet(java.util.Set<T> set,
java.util.Comparator<? super T> comparator)
Sorts the elements in a set into an ordered list
|
boolean |
startsWithUpperCase(java.lang.String string1,
java.lang.String string2)
Compare the uppercase startsWith values of two strings
|
float |
stringToFloat(java.lang.String str)
Takes a string and attempts to turn it into a float.
|
java.lang.String |
stripHTML(java.lang.String content)
Strips HTML from a string, replacing some tags with corresonding text-only equivalents.
|
DataRecord |
tidyDataRecord(DataRecord record)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(DataRecord record,
boolean ignoreLowerCaseKeys)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(DataRecord record,
java.util.Map<java.lang.String,java.lang.Boolean> settings)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(DataRecord record,
java.util.Map<java.lang.String,java.lang.Boolean> settings,
boolean ignoreLowerCaseKeys)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(ScrapeableFile scrapeableFile,
DataRecord record)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(ScrapeableFile scrapeableFile,
DataRecord record,
boolean ignoreLowerCaseKeys)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(ScrapeableFile scrapeableFile,
DataRecord record,
java.util.Map<java.lang.String,java.lang.Boolean> settings)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
DataRecord |
tidyDataRecord(ScrapeableFile scrapeableFile,
DataRecord record,
java.util.Map<java.lang.String,java.lang.Boolean> settings,
boolean ignoreLowerCaseKeys)
Tidies the DataRecord by performing actions based on the values of the settings map given (or getDefaultTidySettings if none is given).
|
java.lang.String |
tidyString(ScrapeableFile scrapeableFile,
java.lang.String value)
Tidies the string by performing actions based on the values of the settings map
|
java.lang.String |
tidyString(ScrapeableFile scrapeableFile,
java.lang.String value,
java.util.Map<java.lang.String,java.lang.Boolean> settings)
Tidies the string by performing actions based on the values of the settings map
|
java.lang.String |
tidyString(java.lang.String value)
Tidies the string by performing actions based on the value of flags, using the flags as the operation list
|
java.lang.String |
tidyString(java.lang.String value,
java.util.Map<java.lang.String,java.lang.Boolean> settings)
Tidies the string by performing actions based on the values of the settings map
|
java.lang.String |
toCamelCase(java.lang.String text)
Converts an input string to have each word start with an uppercase character.
|
void |
unzipFile(java.lang.String zippedFile)
Unzips a file.
|
void |
writeValueToFile(java.lang.Object value,
java.lang.String file,
java.lang.String charSet)
Writes a value to a file using the given character set.
|
public ScrapingUtil(@Nullable ScrapingSession scrapingSession)
scrapingSession
- The session to use@Nullable @RequiredVersion(value=1) public java.lang.String reformatDate(@Nullable java.lang.String date, @Nullable java.lang.String dateFormatFrom, @Nullable java.lang.String dateFormatTo) throws java.lang.Exception
date
- The date to be formatted, as a string.dateFormatFrom
- The pattern of the existing date.dateFormatTo
- The pattern the date should be converted to.java.lang.Exception
- If either of the date formats are invalid.@Nullable @RequiredVersion(value=2) public java.lang.String reformatDate(@Nullable java.lang.String date, @Nullable java.lang.String dateFormatTo) throws java.lang.Exception
date
- The date to be formatted, as a string.dateFormatTo
- The pattern the date should be converted to.java.lang.Exception
- If either of the date formats are invalid.@RequiredVersion(value=2) public int getImageHeight(@NotNull java.lang.String imagePath) throws java.lang.Exception
imagePath
- The path to the image.java.lang.Exception
- If an error occurs while reading the image@RequiredVersion(value=2) public int getImageWidth(@NotNull java.lang.String imagePath) throws java.lang.Exception
imagePath
- The path to the image.java.lang.Exception
- If an error occurs while reading the image@RequiredVersion(value=2) public int getMaximumMemoryAllocation()
@RequiredVersion(value=2) public int getMemoryUsage()
@RequiredVersion(value=2) public int getCpuUsage()
@RequiredVersion(value=1) public void pause(long time)
time
- The amount of time to pause, in milliseconds.@RequiredVersion(value=2) public void resizeImageFixWidth(@NotNull java.lang.String originalFile, @NotNull java.lang.String thumbnailFile, int newWidthSize, boolean deleteOriginalFile) throws java.lang.Exception
originalFile
- The path to the original file.thumbnailFile
- The path where the thumbnail should be created.newWidthSize
- The new width of the image.deleteOriginalFile
- Whether or not the original file should be deleted after the thumbnail is created.java.lang.Exception
- If an error occurrs while resizing the image@RequiredVersion(value=2) public void resizeImageFixHeight(@NotNull java.lang.String originalFile, @NotNull java.lang.String thumbnailFile, int newHeightSize, boolean deleteOriginalFile) throws java.lang.Exception
originalFile
- The path to the original file.thumbnailFile
- The path where the thumbnail should be created.newHeightSize
- The new height of the image.deleteOriginalFile
- Whether or not the original file should be deleted after the thumbnail is created.java.lang.Exception
- If an error occurrs while resizing the image@RequiredVersion(value=2) public void resizeImageFixWidthAndHeight(@NotNull java.lang.String originalFile, @NotNull java.lang.String thumbnailFile, int newWidthSize, int newHeightSize, boolean deleteOriginalFile) throws java.lang.Exception
originalFile
- The path to the original file.thumbnailFile
- The path where the thumbnail should be created.newWidthSize
- The new width of the image.newHeightSize
- The new height of the image.deleteOriginalFile
- Whether or not the original file should be deleted after the thumbnail is created.java.lang.Exception
- If an error occurrs while resizing the image@RequiredVersion(value=2) public void sendMail(java.lang.String subject, java.lang.String body, java.lang.String recipients) throws java.lang.Exception
subject
- The subject line of the e-mail.body
- The text of the body of the e-mail.recipients
- A comma separated list of recipients.java.lang.Exception
- On error sending the mail@RequiredVersion(value=2) public void sendMail(java.lang.String subject, java.lang.String body, java.lang.String recipients, java.lang.String attachments, java.lang.String headers) throws java.lang.Exception
subject
- The subject line of the e-mail.body
- The text of the body of the e-mail.recipients
- A comma separated list of recipients.attachments
- A comma separated list of local files to be attached.headers
- A tab separated list of additional headers one would like to add to the e-mail.java.lang.Exception
- On error sending the mail@RequiredVersion(value=2) public void sendMail(@Nullable java.lang.String subject, @Nullable java.lang.String body, @Nullable java.lang.String recipients, @Nullable java.lang.String contentType, @Nullable java.lang.String attachments, @Nullable java.lang.String headers) throws java.lang.Exception
subject
- The subject line of the e-mail.body
- The text of the body of the e-mail.recipients
- A comma separated list of recipients.contentType
- The content type as a valid MIME type.attachments
- A comma separated list of local files to be attached.headers
- A tab separated list of additional headers one would like to add to the e-mail.java.lang.Exception
- If there is an error preparing or sending the emailpublic boolean isNullOrEmptyString(java.lang.Object object)
object
- The Object
to test.public boolean equalsIgnoreCase(java.lang.String string1, java.lang.String string2)
string1
- The string1 to compare.string2
- The string2 to compare.public boolean startsWithUpperCase(java.lang.String string1, java.lang.String string2)
string1
- The string1 to compare.string2
- The string2 to compare.public boolean isInt(java.lang.Object string) throws java.lang.Exception
String
can be parsed as an int.string
- The String
to check.java.lang.Exception
- If the input value isn't a stringpublic java.lang.String nullToEmptyString(java.lang.Object obj)
obj
- A String
that may be null.public void writeValueToFile(@NotNull java.lang.Object value, @NotNull java.lang.String file, java.lang.String charSet) throws java.lang.Exception
value
- The string to be written.file
- The name of the file.charSet
- The character set to use.java.lang.Exception
- On error writing to the file@Nullable @Contract(value="!null -> !null; null -> null") public java.lang.String convertHTMLEntities(@Nullable java.lang.String val)
val
- The string containing the entities.public void unzipFile(@NotNull java.lang.String zippedFile) throws java.io.IOException
zippedFile
- The path to the zipped file.java.io.IOException
- On error unzipping the file@NotNull public java.lang.String makeGETRequestNoSessionProxy(java.lang.String urlString) throws java.lang.Exception
urlString
- The URL to request, as a string.java.lang.Exception
- If anything naughty happens.@NotNull public java.lang.String makeGETRequestUseSessionProxy(java.lang.String urlString) throws java.lang.Exception
urlString
- The URL to request, as a string.java.lang.Exception
- If anything naughty happens.@NotNull public java.lang.String makeGETRequest(java.lang.String urlString) throws java.lang.Exception
urlString
- The URL to request, as a string.java.lang.Exception
- If anything naughty happens.@NotNull public java.lang.String[][] makeHEADRequest(java.lang.String urlString) throws java.lang.Exception
urlString
- The URL to request, as a string.java.lang.Exception
- If anything naughty happens.@RequiredVersion(value=2) public void makeDELETERequest(java.lang.String urlString) throws java.lang.Exception
urlString
- The URL to request, as a string.java.lang.Exception
- If anything naughty happens.@RequiredVersion(value=2) public void makeDELETERequest(java.lang.String urlString, java.util.Map headers) throws java.lang.Exception
urlString
- The URL to request, as a string.headers
- An optional Map
of request headers.java.lang.Exception
- If anything naughty happens.@RequiredVersion(value=2) public void makePUTRequest(java.lang.String urlString) throws java.lang.Exception
urlString
- The URL to request, as a string.java.lang.Exception
- If anything naughty happens.@RequiredVersion(value=2) public void makePUTRequest(java.lang.String urlString, java.util.Map headers) throws java.lang.Exception
urlString
- The URL to request, as a string.headers
- An optional Map
of request headers.java.lang.Exception
- If anything naughty happens.public java.lang.String getScreenScraperVersion()
@NotNull public java.lang.String getScreenScraperEdition()
public boolean isPlatformLinux()
public boolean isPlatformMac()
public boolean isPlatformWindows()
public java.lang.String getMimeType(@NotNull java.lang.String path) throws java.lang.Exception
path
- The path to the file.java.lang.Exception
- On error determining the Mime type@Nullable public java.lang.String getInstallDir()
@Nullable @RequiredVersion(value=2) public java.lang.String stripHTML(java.lang.String content)
content
- The content to be stripped.@RequiredVersion(value=2) public int getNumRunningScrapingSessions(java.lang.String scrapingSessionName)
scrapingSessionName
- The name of the scraping session to check.@RequiredVersion(value=2) public int getNumRunningScrapingSessions()
@RequiredVersion(value=2) public int getNumRunnableScrapingSessions()
@RequiredVersion(value=1) public float stringToFloat(@NotNull java.lang.String str)
str
- The string to convert.public void setLogInternalMessages(boolean shouldLog)
public boolean getLogInternalMessages()
@Nullable @RequiredVersion(value=1) public java.lang.String formatUSPhoneNumber(@Nullable java.lang.String number)
number
- String containing the phone number. The only digits in this String should be the digits of the phone number.@Nullable @RequiredVersion(value=1) public java.lang.String formatNumber(java.lang.String number, int decimals, boolean padDecimals)
number
- The string representation of the numberdecimals
- How many decimals to displaypadDecimals
- Sets whether or not to force the number of decimals (ie convert 5.1 to 5.10 if 2 decimals are specified)@Nullable @RequiredVersion(value=1) public java.lang.String formatNumber(java.lang.String number, int decimals, boolean padDecimals, boolean powerOfThousandConversion)
number
- The string representation of the numberdecimals
- How many decimals to displaypadDecimals
- Sets whether or not to force the number of decimals (ie convert 5.1 to 5.10 if 2 decimals are specified)powerOfThousandConversion
- True if the formatter should attempt to deal with things like 5k meaning 5000. This can cause unexpected results if
text
is given with the number that isn't actually a power of a thousand@Nullable @RequiredVersion(value=1) public java.lang.String formatNumber(java.lang.String number)
number
- The string representation of the number@Nullable @RequiredVersion(value=1) public java.lang.String formatNumber(@Nullable java.lang.String number, boolean powerOfThousandConversion)
number
- The string representation of the numberpowerOfThousandConversion
- True if the formatter should attempt to deal with things like 5k meaning 5000. This can cause unexpected results if
text
is given with the number that isn't actually a power of a thousand@Nullable @RequiredVersion(value=1) public java.lang.String formatUSZipCode(@Nullable java.lang.String zip)
zip
- String to format as a zip code, either 5 or 9 digits@Nullable @RequiredVersion(value=1) public java.util.Date convertStringToDate(@Nullable java.lang.String dateString, @Nullable java.lang.String format)
dateString
- The date stringformat
- The format of the date, following SimpleDateFormat formatting.@Contract(value="null -> null; !null -> !null") @Nullable public java.lang.String convertUTFWhitespace(@Nullable java.lang.String input)
input
- The input string@Nullable @RequiredVersion(value=1) public java.lang.String convertDateToString(java.util.Date date)
date
- The date to convert@Nullable public java.lang.String convertDateToString(@Nullable java.util.Date date, @Nullable java.lang.String format)
date
- The date to convertformat
- A String representation (as a SimpleDateFormat) for the output@NotNull public java.lang.String getCurrentDate(@Nullable java.lang.String format)
format
- The format for the output string, input in the same format as a SimpleDateFormat
@NotNull public <T> java.util.List<T> sortSet(@NotNull java.util.Set<T> set)
T
- The type of objectset
- The set whose elements should be sorted@NotNull public <T> java.util.List<T> sortSet(@NotNull java.util.Set<T> set, boolean ignoreCase)
T
- The type of objectset
- The set whose elements should be sortedignoreCase
- True if case is irrelevant when sorting strings@NotNull public <T> java.util.List<T> sortSet(@NotNull java.util.Set<T> set, @Nullable java.util.Comparator<? super T> comparator)
T
- The type of objectset
- The set whose elements should be sortedcomparator
- The Comparator used to compare objects in the set to determine order@NotNull @InternalOnly public java.util.Map<java.lang.String,java.lang.Boolean> getDefaultTidySettings()
@Nullable @RequiredVersion(value=1) public java.lang.String tidyString(java.lang.String value)
value
- The String to tidy@Nullable @RequiredVersion(value=1) public java.lang.String tidyString(java.lang.String value, java.util.Map<java.lang.String,java.lang.Boolean> settings)
value
- The String to tidysettings
- The operations to perform when tidying, using a Map<String, Boolean>@Nullable @RequiredVersion(value=1) public java.lang.String tidyString(ScrapeableFile scrapeableFile, java.lang.String value)
scrapeableFile
- The current ScrapeableFile, used for resolving relative URLs when tidying linksvalue
- The String to tidy@Nullable @RequiredVersion(value=1) public java.lang.String tidyString(@Nullable ScrapeableFile scrapeableFile, @Nullable java.lang.String value, @Nullable java.util.Map<java.lang.String,java.lang.Boolean> settings)
scrapeableFile
- The current ScrapeableFile, used for resolving relative URLs when tidying linksvalue
- The String to tidysettings
- The operations to perform when tidying, using a Map<String, Boolean>@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(DataRecord record)
record
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(DataRecord record, boolean ignoreLowerCaseKeys)
record
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)ignoreLowerCaseKeys
- True if values with keys containing lowercase characters should be ignored@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(DataRecord record, java.util.Map<java.lang.String,java.lang.Boolean> settings)
record
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)settings
- The operations to perform when tidying, using a Map<String, Boolean>@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(DataRecord record, java.util.Map<java.lang.String,java.lang.Boolean> settings, boolean ignoreLowerCaseKeys)
record
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)settings
- The operations to perform when tidying, using a Map<String, Boolean>ignoreLowerCaseKeys
- True if values with keys containing lowercase characters should be ignored@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(ScrapeableFile scrapeableFile, DataRecord record)
scrapeableFile
- The current ScrapeableFile, used for resolving relative URLs when tidying linksrecord
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(ScrapeableFile scrapeableFile, DataRecord record, boolean ignoreLowerCaseKeys)
scrapeableFile
- The current ScrapeableFile, used for resolving relative URLs when tidying linksrecord
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)ignoreLowerCaseKeys
- True if values with keys containing lowercase characters should be ignored@Nullable @RequiredVersion(value=1) public DataRecord tidyDataRecord(ScrapeableFile scrapeableFile, DataRecord record, java.util.Map<java.lang.String,java.lang.Boolean> settings)
scrapeableFile
- The current ScrapeableFile, used for resolving relative URLs when tidying linksrecord
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)settings
- The operations to perform when tidying, using a Map<String, Boolean>@Nullable @RequiredVersion(value=1) @Contract(value="_, null, _, _ -> null; _, !null, _, _ -> !null") public DataRecord tidyDataRecord(ScrapeableFile scrapeableFile, @Nullable DataRecord record, java.util.Map<java.lang.String,java.lang.Boolean> settings, boolean ignoreLowerCaseKeys)
scrapeableFile
- The current ScrapeableFile, used for resolving relative URLs when tidying linksrecord
- The DataRecord to tidy (values in the record will be overwritten with the tidied values)settings
- The operations to perform when tidying, using a Map<String, Boolean>ignoreLowerCaseKeys
- True if values with keys containing lowercase characters should be ignored@NotNull @RequiredVersion(value=1) public DataSet getOptionSet(@Nullable java.lang.String options)
options
- The text containing the select tag@NotNull @RequiredVersion(value=1) public DataSet getOptionSet(@Nullable java.lang.String options, @Nullable java.lang.String ignoreLabel)
options
- The text containing the select tagignoreLabel
- Text value to ignore in the output set. Usually this would be a string like "Please select a category"@NotNull @RequiredVersion(value=1) public DataSet getOptionSet(@Nullable java.lang.String options, @Nullable java.lang.String ignoreLabel, boolean tidyRecords)
options
- The text containing the select tagignoreLabel
- Text value to ignore in the output set. Usually this would be a string like "Please select a category"tidyRecords
- Should the TEXT be tidied before being stored.@NotNull @RequiredVersion(value=1) public DataSet getOptionSet(@Nullable java.lang.String options, @Nullable java.lang.String[] ignoreLabels, boolean tidyRecords)
options
- The text containing the select tagignoreLabels
- Text values to ignore in the output set. Usually this would include the strings like "Please select a category"tidyRecords
- Should the TEXT be tidied before being stored.@NotNull @RequiredVersion(value=1) public DataSet getOptionSet(@Nullable java.lang.String options, @Nullable java.util.Collection<java.lang.String> ignoreLabels, boolean tidyRecords)
options
- The text containing the select tagignoreLabels
- Text values to ignore in the output set. Usually this would include the strings like "Please select a category"tidyRecords
- Should the TEXT be tidied before being stored.@NotNull @RequiredVersion(value=1) public DataSet getRadioButtonSet(java.lang.String buttons, java.lang.String buttonName)
buttons
- The text containing the buttonsbuttonName
- The name of the buttons that should be grabbed, as a Regex pattern@NotNull @RequiredVersion(value=1) public DataSet getRadioButtonSet(java.lang.String buttons, java.lang.String buttonName, @Nullable java.lang.String ignoreLabel)
buttons
- The text containing the buttonsbuttonName
- The name of the buttons that should be grabbed, as a Regex patternignoreLabel
- A label that should be excluded from the resulting set@NotNull @RequiredVersion(value=1) public DataSet getRadioButtonSet(java.lang.String buttons, java.lang.String buttonName, @Nullable java.lang.String[] ignoreLabels)
buttons
- The text containing the buttonsbuttonName
- The name of the buttons that should be grabbed, as a Regex patternignoreLabels
- Any labels that should be excluded from the resulting set@NotNull @RequiredVersion(value=1) public DataSet getRadioButtonSet(java.lang.String buttons, java.lang.String buttonName, java.util.Collection<java.lang.String> ignoreLabels)
buttons
- The text containing the buttonsbuttonName
- The name of the buttons that should be grabbed, as a Regex patternignoreLabels
- Any labels that should be excluded from the resulting set@NotNull @RequiredVersion(value=1) public DataSet getRadioButtonSet(@Nullable java.lang.String buttons, java.lang.String buttonName, @Nullable java.util.Collection<java.lang.String> ignoreLabels, boolean tidyRecords)
buttons
- The text containing the buttonsbuttonName
- The name of the buttons that should be grabbed, as a Regex patternignoreLabels
- Any labels that should be excluded from the resulting settidyRecords
- True if the text label should be tidied, false to leave it exactly as it was@NotNull @RequiredVersion(value=1) public DataRecord mergeDataRecords(@NotNull DataRecord first, @NotNull DataRecord second, boolean saveNonEmptyString)
first
- The first DataRecord, into which the values from the second record will be copiedsecond
- The second DataRecord, whose values will be copied into the firstsaveNonEmptyString
- True if blank values should not overwrite non-blank values, whether the non-blank value is in the first or second record. If
false, all values in the second record will overwrite any values in the first record.public double linear(double number, double minIn, double maxIn, double minOut, double maxOut)
number
- The input valueminIn
- The minimum value the input should bemaxIn
- The maximum value the input should beminOut
- The minimum value the output should bemaxOut
- The maximum value the output should be@Nullable public java.lang.String toCamelCase(@Nullable java.lang.String text)
text
- The text to convert@Nullable public java.lang.String convertFromUpperCase(@Nullable java.lang.String text)
text
- The text to convert@RequiredVersion(value=1) public void randomPause(long min, long max)
min
- The minimum duration of the pause, in millisecondsmax
- The maximum duration of the pause, in milliseconds@Deprecated @InternalOnly @RequiredVersion(value=1, behavior=LOG_ERROR_AND_RETURN_NULL_NEG_ONE_OR_FALSE) public void runMultipleScrapes(@Nullable java.lang.String scrapeName, @Nullable java.lang.String key, @Nullable java.lang.String file, int maxConcurrentScrapes) throws java.lang.Exception
scrapeName
- The scrape to runkey
- The session variable to set values forfile
- The file containing the values, 1 per line, with ### indicating a comment. Values will be trimmedmaxConcurrentScrapes
- The maximum number of scrapes that can be run at oncejava.lang.Exception
- If no valid scraping session can be found with the given name@Deprecated @InternalOnly public void runMultipleScrapes(java.lang.String scrapeName, java.lang.String key, @NotNull java.lang.Object[] values, int maxConcurrentScrapes) throws java.lang.Exception
scrapeName
- The scrape to runkey
- The session variable to set values forvalues
- The values to set under the given key for each scrapemaxConcurrentScrapes
- The maximum number of scrapes that can be run at oncejava.lang.Exception
- If no valid scraping session could be found with the given name@Deprecated @InternalOnly public void runMultipleScrapes(java.lang.String scrapeName, java.lang.String key, java.util.List<?> values, int maxConcurrentScrapes) throws java.lang.Exception
scrapeName
- The scrape to runkey
- The session variable to set values forvalues
- The values to set under the given key for each scrapemaxConcurrentScrapes
- The maximum number of scrapes that can be run at oncejava.lang.Exception
- If no valid scraping session could be found with the given name@Deprecated @InternalOnly @RequiredVersion(value=1, behavior=LOG_ERROR_AND_RETURN_NULL_NEG_ONE_OR_FALSE) public void runMultipleScrapes(@Nullable java.lang.String scrapeName, @Nullable java.lang.String key, @Nullable java.util.List<?> values, int maxConcurrentScrapes, boolean shouldInheritFromParent) throws java.lang.Exception
scrapeName
- The scrape to runkey
- The session variable to set values forvalues
- The values to set under the given key for each scrapemaxConcurrentScrapes
- The maximum number of scrapes that can be run at onceshouldInheritFromParent
- True is run scrapes should inherit everything from the parent scrape, false to have each start without inheritingjava.lang.Exception
- If no valid scraping session could be found with the given name@RequiredVersion(value=1) public boolean dateIsWithinDays(@NotNull java.util.Date date1, @NotNull java.util.Date date2, int days)
date1
- The first datedate2
- The second datedays
- The maximum number of days that can be between the two dates@Nullable @RequiredVersion(value=1) public XmlNode applyXPathExpression(@NotNull java.lang.String content, java.lang.String expression)
expression
- An XPath expression.content
- The string the expression should be applied to.XmlNode
.@Nullable @RequiredVersion(value=1) public java.lang.String extractXmlBlock(@NotNull java.lang.String content, int startingDepth)
content
- The content to extract from (the start of the string should already be at the desired location to start extraction). If the startingDepth
is 0, the content should start with an opening tagstartingDepth
- The current depth of open elements, in general this will be 0@Nullable @RequiredVersion(value=1) public Name parseName(@NotNull java.lang.String name)
EnglishNameParser
classname
- The name to be parsedName
objectjava.lang.IllegalArgumentException
- If the parse fails. The cause of the exception will contain additional information about the parse error@Nullable @RequiredVersion(value=1) public Address parseUSAddress(@NotNull java.lang.String address)
USAddressParser
class by providing different constraints in the builder. This method is here for convenience in working with US addressesaddress
- The address to be parsedAddress
objectjava.lang.IllegalArgumentException
- If the parse fails. The cause of the exception will contain additional information about the parse error@NotNull @RequiredVersion(value=1) public Address reorderUSAddressBestGuessFromLines(@Nullable java.lang.String addressee, @Nullable java.lang.String address, @Nullable java.lang.String address2)
addressee
- The assumed addressee lineaddress
- The assumed address (street) lineaddress2
- The assumed secondary address (suite or apartment) lineAddress
object with the addressee, address, and suiteOrApartment values filled in based on the
given input here@NotNull public java.lang.String getRandomUserAgent()
@Nullable public java.lang.String getRandomUserAgent(@Nullable BrowserType browserType, @Nullable java.time.LocalDate newerThan, @Nullable java.time.LocalDate olderThan)
browserType
- The type of browser for which to get a user agentnewerThan
- User agents that are newer than (or the same as) this date. Null means no lower release date boundolderThan
- User agents that are older than (or the same as) this date. Null means no upper release date bound@NotNull public java.lang.Object getTimestampObject()
~#TIMESTAMP#~
to get the current timestamp. Just set the session variable first, like session.setVariable("TIMESTAMP",
sutil.getTimestampObject());
public java.lang.String getRandomReferrer()
@Nullable public org.json.JSONObject getJSONObject(@Nullable org.json.JSONObject json, @NotNull java.lang.String key) throws org.json.JSONException
json
- The input objectkey
- The key. The key can be a path (such as foo.bar[0].name)org.json.JSONException
- If there is a json error (shouldn't happen unless a key is invalid)@Nullable public org.json.JSONArray getJSONArray(@Nullable org.json.JSONObject json, @NotNull java.lang.String key) throws org.json.JSONException
json
- The input objectkey
- The key. The key can be a path (such as foo.bar[0].name)org.json.JSONException
- If there is a json error (shouldn't happen unless a key is invalid)@Nullable public java.lang.String getJSONString(@Nullable org.json.JSONObject json, @NotNull java.lang.String key) throws org.json.JSONException
json
- The input objectkey
- The key. The key can be a path (such as foo.bar[0].name)org.json.JSONException
- If there is a json error (shouldn't happen unless a key is invalid)@Contract(value="_, _, null -> _; _, _, !null -> !null") @Nullable public java.lang.String getJSONString(@Nullable org.json.JSONObject json, @NotNull java.lang.String key, @Nullable java.lang.String defaultValue) throws org.json.JSONException
json
- The input objectkey
- The key. The key can be a path (such as foo.bar[0].name)defaultValue
- The value to return if the resulting value is null (either a non-present key or a null value for the key)org.json.JSONException
- If there is a json error (shouldn't happen unless a key is invalid)@RequiredVersion(value=1) public boolean alphabetLoopWithSubdivision(@Nullable java.lang.String letters, @NotNull java.util.function.Function<java.lang.String,java.lang.Boolean> function)
letters
- The starting letters for subdivision, or null to start with the empty string. Note passing in 'c' doesn't mean it will start at 'c' and then search 'd'. It will simply search 'c' and if false is
returned by the function it will end, or if true is returned it'll then search 'ca', 'cb', etc...function
- The function to run for the actual search. The input is the string for the current alphabet search (never null but can be empty) and the output is a boolean for whether subdivision is required or
not@RequiredVersion(value=1) public boolean alphabetLoopWithSubdivision(@Nullable java.lang.String letters, @NotNull java.util.function.Function<java.lang.String,java.lang.Boolean> function, boolean includeAlpha, boolean includeDigits, @Nullable java.lang.String skipToLetters)
letters
- The starting letters for subdivision, or null to start with the empty string. Note passing in 'c' doesn't mean it will start at 'c' and then search 'd'. It will simply search 'c' and if false is
returned by the function it will end, or if true is returned it'll then search 'ca', 'cb', etc...function
- The function to run for the actual search. The input is the string for the current alphabet search (never null but can be empty) and the output is a boolean for whether subdivision is required or
notincludeAlpha
- True if it should include letters in the subdivisionincludeDigits
- True if it should include digits in the subdivisionskipToLetters
- The letters to skip to before calling the passed in function. This will run regular subdivision until it reaches these letters and then call the function (null/empty means not to skip any)@RequiredVersion(value=1) public boolean alphabetLoopWithSubdivision(@Nullable java.lang.String firstLetters, @Nullable java.lang.String lastLetters, @NotNull java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Boolean> function)
firstLetters
- The starting letters for subdivision on the first letter set, or null to start with the empty string. Note passing in 'c' doesn't mean it will start at 'c' and then search 'd'. It will
simply search 'c' and if false is returned by the function it will end, or if true is returned it'll then search 'ca', 'cb', etc...lastLetters
- The starting letters for subdivision on the second letter set, or null to start with the empty string. Note passing in 'c' doesn't mean it will start at 'c' and then search 'd'. It will
simply search 'c' and if false is returned by the function it will end, or if true is returned it'll then search 'ca', 'cb', etc...function
- The function to run for the actual search. The input is the string for the current alphabet search (never null but can be empty) and the output is a boolean for whether subdivision is required or
not@RequiredVersion(value=1) public boolean alphabetLoopWithSubdivision(@Nullable java.lang.String firstLetters, @Nullable java.lang.String lastLetters, @NotNull java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.Boolean> function, boolean includeAlpha, boolean includeDigits, @Nullable java.lang.String skipToFirstLetters, @Nullable java.lang.String skipToLastLetters)
firstLetters
- The starting letters for subdivision on the first letter set, or null to start with the empty string. Note passing in 'c' doesn't mean it will start at 'c' and then search 'd'. It will
simply search 'c' and if false is returned by the function it will end, or if true is returned it'll then search 'ca', 'cb', etc...lastLetters
- The starting letters for subdivision on the second letter set, or null to start with the empty string. Note passing in 'c' doesn't mean it will start at 'c' and then search 'd'. It will
simply search 'c' and if false is returned by the function it will end, or if true is returned it'll then search 'ca', 'cb', etc...function
- The function to run for the actual search. The input is the string for the current alphabet search (never null but can be empty) and the output is a boolean for whether subdivision is required or
notincludeAlpha
- True if it should include letters in the subdivisionincludeDigits
- True if it should include digits in the subdivisionskipToFirstLetters
- The letters to skip to for first letters before calling the passed in function. This will run regular subdivision until it reaches these letters and then call the function once both
skip to letter values are reached (null/empty means not to skip any)skipToLastLetters
- The letters to skip to for last letters before calling the passed in function. This will run regular subdivision until it reaches these letters and then call the function once both skip
to letter values are reached (null/empty means not to skip any)@RequiredVersion(value=2) public <T> void runMultipleSessionsConcurrentlyForInput(int numToRun, @NotNull java.util.function.Function<T,java.util.List<T>> individualRunFunction, @NotNull java.util.concurrent.Callable<java.util.function.Supplier<T>> searchInputSupplierInitializer)
T
- The type of object returned by the supplier and passed to the run function.numToRun
- How many scrapes to run in parallel. Must be at least 1 which means the current scrape. Note that when running in the workbench this only uses a single thread (the current one) even if a larger
number is passed inindividualRunFunction
- A function that is called for each input from the supplier. It returns a List of that type (or null) of things to add to the search input, such as any subdivisions to search. Empty
or null indicates nothing new needs to be added to the search inputssearchInputSupplierInitializer
- A callable to return a supplier that returns the search elements. This supplier should return null to indicate no more search inputs are found. A callable is used so the
initialization only has to be performed on the controlling thread. Note the supplier returned will be called as space is available (elements are needed) to avoid excessive memory use. Also, if the scrape is
stopped the get method will no longer be called, so any resource cleanup should be done with callbacks on scrape end to avoid leaking open resources@RequiredVersion(value=2) public <T> void runMultipleSessionsConcurrentlyForInput(int numToRun, int queueSize, @NotNull java.util.function.Function<T,java.util.List<T>> processInputFunction, @NotNull java.util.concurrent.Callable<java.util.function.Supplier<T>> supplierInitializer)
T
- The type of object returned by the supplier and passed to the run function.numToRun
- How many scrapes to run in parallel. Must be at least 1 which means the current scrape. Note that when running in the workbench this only uses a single thread (the current one) even if a larger
number is passed inqueueSize
- How large of a queue to have from the input supplier for the workers. The value must be at least 1 (if it is less than one it will default to 1).processInputFunction
- A function that is called for each input from the supplier. It returns a List of that type (or null) of things to add to the search input, such as any subdivisions to search. Empty
or null indicates nothing new needs to be added to the search inputssupplierInitializer
- A callable to return a supplier that returns the search elements. This supplier should return null to indicate no more search inputs are found. A callable is used so the
initialization only has to be performed on the controlling thread. Note the supplier returned will be called as space is available (elements are needed) to avoid excessive memory use. Also, if the scrape is
stopped the get method will no longer be called, so any resource cleanup should be done with callbacks on scrape end to avoid leaking open resourcespublic void setupAutoIncrementParentScrapeRecordsFromChild(@NotNull ScrapingSession parent)
parent
- The parent scrape for which record counts should be adjusted when this scrape updates record counts