crawly icon indicating copy to clipboard operation
crawly copied to clipboard

Provide more examples / detailed docs on custom request header override per spider

Open DaniruKun opened this issue 3 years ago • 3 comments

I have a situation where I need to supply a custom consent cookie to a specific spider. While it is described how to do it for the middleware, it is not very clear still how to pass e.g. custom headers to the init/1 callback of Crawly.Spider.

Even a small example or such will help and can help with writing a good example in docs, thanks!

DaniruKun avatar Mar 10 '21 22:03 DaniruKun

Why not use start_requests: ?

https://github.com/elixir-crawly/crawly/blob/c02e408dc84754bf8903515a9906c36ee51d04c0/test/manager_test.exs#L165

darkslategrey avatar Oct 04 '21 23:10 darkslategrey

https://hexdocs.pm/crawly/basic_concepts.html#behaviour-functions

Ziinc avatar Nov 26 '22 18:11 Ziinc

  • [ ] add in examples
    • [ ] add to https://hexdocs.pm/crawly/basic_concepts.html#behaviour-functions, link to callback docs
    • [ ] add to https://hexdocs.pm/crawly/Crawly.Spider.html#c:init/1 , main doc reference.

Ziinc avatar Nov 26 '22 18:11 Ziinc