MCPcopy
hub / github.com/crawlab-team/artipub / setCookies

Method setCookies

backend/spiders/base.ts:185–195  ·  view source on GitHub ↗

* 设置Cookie

()

Source from the content-addressed store, hash-verified

183 * 设置Cookie
184 */
185 async setCookies() {
186 const cookies = await models.Cookie.find({ domain: this.getCookieDomainCondition() });
187 for (let i = 0; i < cookies.length; i++) {
188 const c = cookies[i];
189 await this.page.setCookie({
190 name: c.name,
191 value: c.value,
192 domain: c.domain,
193 });
194 }
195 }
196
197 /**
198 * 获取可给axios 使用的cookie

Callers 3

runMethod · 0.95
fetchMethod · 0.80
importMethod · 0.80

Calls 1

Tested by

no test coverage detected