public class ExtractorJS extends ContentExtractor
Modifier and Type | Field and Description |
---|---|
protected static String |
JAVASCRIPT_STRING_EXTRACTOR |
protected long |
numberOfCURIsHandled |
DEFAULT_PARAMETERS, extractorParameters, loggerModule, numberOfLinksExtracted
Constructor and Description |
---|
ExtractorJS() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
considerString(Extractor ext,
CrawlURI curi,
boolean handlingJSFile,
String candidate) |
protected long |
considerStrings(CrawlURI curi,
CharSequence cs) |
long |
considerStrings(Extractor ext,
CrawlURI curi,
CharSequence cs) |
long |
considerStrings(Extractor ext,
CrawlURI curi,
CharSequence cs,
boolean handlingJSFile) |
protected boolean |
innerExtract(CrawlURI curi)
Actually extracts links.
|
protected boolean |
shouldExtract(CrawlURI uri)
Determines if otherwise valid URIs should have links extracted or not.
|
extract, shouldProcess
addOutlink, fromCheckpointJson, getExtractorParameters, getLoggerModule, innerProcess, logUriError, report, setExtractorParameters, setLoggerModule, toCheckpointJson
doCheckpoint, finishCheckpoint, flattenVia, getBeanName, getEnabled, getKeyedProperties, getRecordedSize, getShouldProcessRule, getURICount, hasHttpAuthenticationCredential, innerProcessResult, innerRejectProcess, isRunning, isSuccess, process, setBeanName, setEnabled, setRecoveryCheckpoint, setShouldProcessRule, start, startCheckpoint, stop
protected static final String JAVASCRIPT_STRING_EXTRACTOR
protected long numberOfCURIsHandled
protected boolean shouldExtract(CrawlURI uri)
ContentExtractor
ExtractorHTML
implementation checks that the content-type of
the given URI is text/html.shouldExtract
in class ContentExtractor
uri
- the URI to checkprotected boolean innerExtract(CrawlURI curi)
ContentExtractor
#shouldProcess(ExtractorURI)
. Subclasses
should implement this method to discover outlinks in the URI's
content stream. For instance, ExtractorHTML
extracts links
from Anchor tags and so on.
This method should only return true if extraction completed successfully. If not (for instance, if an IO error occurred), then this method should return false. Returning false indicates to the pipeline that downstream extractors should attempt to extract links themselves. Returning true indicates that downstream extractors should be skipped.
innerExtract
in class ContentExtractor
curi
- the URI whose links to extractprotected long considerStrings(CrawlURI curi, CharSequence cs)
public long considerStrings(Extractor ext, CrawlURI curi, CharSequence cs)
public long considerStrings(Extractor ext, CrawlURI curi, CharSequence cs, boolean handlingJSFile)
Copyright © 2003-2014 Internet Archive. All Rights Reserved.