docs: style adjustment
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Spiders sessions
|
||||
|
||||
A spider can use multiple fetcher sessions simultaneously — for example, a fast HTTP session for simple pages and a stealth browser session for protected pages.
|
||||
A spider can use multiple fetcher sessions simultaneously. For example, a fast HTTP session for simple pages and a stealth browser session for protected pages.
|
||||
|
||||
## What are Sessions?
|
||||
|
||||
@@ -18,7 +18,7 @@ By default, every spider creates a single [FetcherSession](../fetching/static.md
|
||||
|
||||
## Configuring Sessions
|
||||
|
||||
Override `configure_sessions()` on your spider to set up sessions. The `manager` parameter is a `SessionManager` instance — use `manager.add()` to register sessions:
|
||||
Override `configure_sessions()` on your spider to set up sessions. The `manager` parameter is a `SessionManager` instance - use `manager.add()` to register sessions:
|
||||
|
||||
```python
|
||||
from scrapling.spiders import Spider, Response
|
||||
@@ -90,7 +90,7 @@ class ProductSpider(Spider):
|
||||
}
|
||||
```
|
||||
|
||||
The key is the `sid` parameter — it tells the spider which session to use for each request. When you call `response.follow()` without `sid`, the session ID from the original request is inherited.
|
||||
The key is the `sid` parameter - it tells the spider which session to use for each request. When you call `response.follow()` without `sid`, the session ID from the original request is inherited.
|
||||
|
||||
Sessions can also be different instances of the same class with different configurations:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user