abstract |
---|
Simulates a browser.
To make the actual request, you need to implement the doRequest() method.
If you want to be able to run requests in their own process (insulated flag), you need to also implement the getScript() method.
Methods | ||
---|---|---|
public
|
__construct(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
|
# |
public
|
followRedirects(bool $followRedirects = true)
|
# |
public
|
followMetaRefresh(bool $followMetaRefresh = true)
|
# |
public
|
isFollowingRedirects(): bool
|
# |
public
|
setMaxRedirects(int $maxRedirects)
|
# |
public
|
getMaxRedirects(): int
|
# |
public
|
insulate(bool $insulated = true)
|
# |
public
|
setServerParameters(array $server)
|
# |
public
|
setServerParameter(string $key, string $value)
|
# |
public
|
getServerParameter(string $key, mixed $default = ''): mixed
|
# |
public
|
xmlHttpRequest(
string $method,
string $uri,
array $parameters = [],
array $files = [],
array $server = [],
?string $content = null,
bool $changeHistory = true,
): Crawler
|
# |
public
|
jsonRequest(
string $method,
string $uri,
array $parameters = [],
array $server = [],
bool $changeHistory = true,
): Crawler
|
# |
public
|
getHistory(): History
|
# |
public
|
getCookieJar(): CookieJar
|
# |
public
|
getCrawler(): Crawler
|
# |
public
|
getInternalResponse(): Response
|
# |
public
|
getResponse(): object
|
# |
public
|
getInternalRequest(): Request
|
# |
public
|
getRequest(): object
|
# |
public
|
click(Link $link): Crawler
|
# |
public
|
clickLink(string $linkText): Crawler
|
# |
public
|
submit(Form $form, array $values = [], array $serverParameters = []): Crawler
|
# |
public
|
submitForm(string $button, array $fieldValues = [], string $method = 'POST', array $serverParameters = []): Crawler
|
# |
public
|
request(
string $method,
string $uri,
array $parameters = [],
array $files = [],
array $server = [],
string $content = null,
bool $changeHistory = true,
): Crawler
|
# |
protected
|
doRequestInProcess(object $request): object
|
# |
abstract
protected
|
doRequest(object $request): object
|
# |
protected
|
getScript(object $request)
|
# |
protected
|
filterRequest(Request $request): object
|
# |
protected
|
filterResponse(object $response): Response
|
# |
protected
|
createCrawlerFromContent(string $uri, string $content, string $type): Crawler|null
|
# |
public
|
back(): Crawler
|
# |
public
|
forward(): Crawler
|
# |
public
|
reload(): Crawler
|
# |
public
|
followRedirect(): Crawler
|
# |
public
|
restart()
|
# |
protected
|
getAbsoluteUri(string $uri): string
|
# |
protected
|
requestFromRequest(Request $request, bool $changeHistory = true): Crawler
|
# |
Properties | |||
---|---|---|---|
protected
|
|
$history
|
# |
protected
|
|
$cookieJar
|
# |
protected
|
|
$server = []
|
# |
protected
|
|
$internalRequest
|
# |
protected
|
|
$request
|
# |
protected
|
|
$internalResponse
|
# |
protected
|
|
$response
|
# |
protected
|
|
$crawler
|
# |
protected
|
|
$insulated = false
|
# |
protected
|
|
$redirect
|
# |
protected
|
|
$followRedirects = true
|
# |
protected
|
|
$followMetaRefresh = false
|
# |