spatie / crawler

An easy to use, powerful crawler implemented in PHP. Can execute Javascript.

Home Page:https://freek.dev/308-building-a-crawler-in-php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

http referer of the crawled url

aimagician opened this issue · comments

Hello

Can I get an HTTP referer of the crawled URL, in this case, it is the parent URL?

  • parent page
    • first child page(FCP)
      • child page (i am crawling child page, I need an URL of the FCP)

Thank you

As you can check

abstract public function crawled(
UriInterface $url,
ResponseInterface $response,
?UriInterface $foundOnUrl = null
): void;

An observer receives the url where the current url was found. You could create an observer to store this data.

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.