roach-php / core

The complete web scraping toolkit for PHP.
https://roach-php.dev
1.36k stars 70 forks source link

Overriding Not Working #79

Closed sinarahmany closed 1 year ago

sinarahmany commented 1 year ago

Hi, hope all is well, Im trying to pass the URL dynamically using overriding but its not working and the response is null. Thank you

Roach::startSpider(
            LoremIpsumSpider::class,
            new Overrides(startUrls: ['https://sinarahmannejad.com']),
        );

        $result = Roach::collectSpider(LoremIpsumSpider::class);
beunwa commented 1 year ago

same problem here

beunwa commented 1 year ago

my bad it works fine, but dont forget to also provide Overrides in your Roach::collectSpider call

ksassnowski commented 1 year ago

Just to be clear, you're supposed to either call startSpider or collectSpider.https://roach-php.dev/docs/spiders/#retrieving-scraped-items-after-a-run