Overriding Spider conf or passing context doesn't work
wassim opened this issue · comments
I'm calling another spider from my main spider with overrides and context but the second spider doesn't catch any of those.
class MainSpider extends BasicSpider
{
...
public function parse(Response $response): Generator
{
...
Roach::startSpider(
AnotherSpider::class,
new Overrides(startUrls: ['https://github.com']),
context: ['name' => 'test']
)
class AnotherSpider extends BasicSpider
{
// here I have to redefine $startUrls because the spider doesn't apply the overrides...
public function parse(Response $response): Generator
{
dd($this-context); // returns empty array
}
}
Can you provide an example repository that reproduces this issue?
Closing this due to inactivity. Feel free to reopen if you have more information.