Replies: 1 comment
-
Where is answer ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Use $response->getCachedBody() instead of $response->getBody() . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
public function crawled(UriInterface $url, ResponseInterface $response, ?UriInterface $foundOnUrl = null)
{
$urls = Cache::get($this->successUrlsCacheName, []);
$urls[] = [
'url' => urldecode($url),
'found_on_url' => urldecode($foundOnUrl),
'code' => $response->getStatusCode()
];
Cache::put($this->successUrlsCacheName, $urls);
$body = (string) $response->getBody();
Log::debug('Crawler: ' . $url . ' has be crawled.', ['body' => serialize($body)]);
}
I just get nothing from it, $response->getStatusCode() could work properly, but getBody can't.
Here is my full script:
Beta Was this translation helpful? Give feedback.
All reactions