Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

fixed docs.

Petr Patek641c4e2396d1
diff --git a/docs/api/Session.md b/docs/api/Session.md
index e24b82db2..a2c5c127f 100644
--- a/docs/api/Session.md
+++ b/docs/api/Session.md
@@ -19,6 +19,9 @@ internal state can be enriched with custom user data for example some authorizat
- [`.getState()`](#Session+getState) ⇒ `Object`
- [`.retire()`](#Session+retire)
- [`.markBad()`](#Session+markBad)
+ - [`.checkStatus(statusCode)`](#Session+checkStatus) ⇒ `boolean`
+ - [`.setCookiesToJar(response)`](#Session+setCookiesToJar)
+ - [`.getCookieString(url)`](#Session+getCookieString) ⇒ `String`
<a name="new_Session_new"></a>
@@ -148,3 +151,66 @@ due to some external factors as server error such as 5XX you probably want to us
## `session.markBad()`
Increases usage and error count. Should be used when the session has been used unsuccessfully. For example because of timeouts.
+
+<a name="Session+checkStatus"></a>
+
+## `session.checkStatus(statusCode)` ⇒ `boolean`
+
+Retires session based on status code.
+
+**Returns**: `boolean` - - whether the session was retired
+
+<table>
+<thead>
+<tr>
+<th>Param</th><th>Type</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>statusCode</code></td><td><code>Number</code></td>
+</tr>
+<tr>
+<td colspan="3"><p>HTTP status code</p>
+</td></tr></tbody>
+</table>
+<a name="Session+setCookiesToJar"></a>
+
+## `session.setCookiesToJar(response)`
+
+Sets cookies from response to the cookieJar. Parses cookies from "set-cookie" header and sets them to "Session.cookieJar".
+
+<table>
+<thead>
+<tr>
+<th>Param</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>response</code></td>
+</tr>
+<tr>
+</tr></tbody>
+</table>
+<a name="Session+getCookieString"></a>
+
+## `session.getCookieString(url)` ⇒ `String`
+
+Wrapper around "tough" cookie jar `getCookieString` method.
+
+**Returns**: `String` - ;
+
+<table>
+<thead>
+<tr>
+<th>Param</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>url</code></td>
+</tr>
+<tr>
+</tr></tbody>
+</table>