public class Page extends Object
getUrl()
get url of current page getHtml()
get content of current page putField(String, Object)
save extracted result getResultItems()
get extract results to be used in Pipeline
addTargetRequests(java.util.List)
addTargetRequest(String)
add urls to fetch Downloader
,
PageProcessor
Constructor and Description |
---|
Page() |
Modifier and Type | Method and Description |
---|---|
void |
addTargetRequest(Request request)
add requests to fetch
|
void |
addTargetRequest(String requestString)
add url to fetch
|
void |
addTargetRequests(List<String> requests)
add urls to fetch
|
void |
addTargetRequests(List<String> requests,
long priority)
add urls to fetch
|
static Page |
fail() |
byte[] |
getBytes() |
String |
getCharset() |
Map<String,List<String>> |
getHeaders() |
Html |
getHtml()
get html content of page
|
Json |
getJson()
get json content of page
|
String |
getRawText() |
Request |
getRequest()
get request of current page
|
ResultItems |
getResultItems() |
int |
getStatusCode() |
List<Request> |
getTargetRequests() |
Selectable |
getUrl()
get url of current page
|
boolean |
isDownloadSuccess() |
void |
putField(String key,
Object field)
store extract results
|
void |
setBytes(byte[] bytes) |
void |
setCharset(String charset) |
void |
setDownloadSuccess(boolean downloadSuccess) |
void |
setHeaders(Map<String,List<String>> headers) |
void |
setHtml(Html html)
Deprecated.
since 0.4.0
The html is parse just when first time of calling
getHtml() , so use setRawText(String) instead. |
Page |
setRawText(String rawText) |
void |
setRequest(Request request) |
Page |
setSkip(boolean skip) |
void |
setStatusCode(int statusCode) |
void |
setUrl(Selectable url) |
String |
toString() |
public static Page fail()
public Page setSkip(boolean skip)
public void putField(String key, Object field)
key
- keyfield
- fieldpublic Html getHtml()
public Json getJson()
public void setHtml(Html html)
getHtml()
, so use setRawText(String)
instead.html
- htmlpublic void addTargetRequests(List<String> requests)
requests
- requestspublic void addTargetRequests(List<String> requests, long priority)
requests
- requestspriority
- prioritypublic void addTargetRequest(String requestString)
requestString
- requestStringpublic void addTargetRequest(Request request)
request
- requestpublic Selectable getUrl()
public void setUrl(Selectable url)
public Request getRequest()
public void setRequest(Request request)
public ResultItems getResultItems()
public int getStatusCode()
public void setStatusCode(int statusCode)
public String getRawText()
public boolean isDownloadSuccess()
public void setDownloadSuccess(boolean downloadSuccess)
public byte[] getBytes()
public void setBytes(byte[] bytes)
public String getCharset()
public void setCharset(String charset)
Copyright © 2017. All rights reserved.