if (!!cachedCookie) {
var trim = function (c) {
return c.replace(/^\s+/, "").replace(/\s+$/, "")
};
var cookieArr = decodeURIComponent(cachedCookie).split(';');
console.log(decodeURIComponent(cachedCookie));
var pair;
var k, v;
if ("" != cookieArr[0]) {
for (var i = 0; i < cookieArr.length; ++i) {
pair = cookieArr[i].split("=");
k = trim(pair[0]);
v = cookieArr[i].substring(pair[0].length + 1);
console.log("addCachedCookieStatus:" + i.toString()+"k :" + k +"v:"+v+ phantom.addCookie({
'name': k, /* required property */
'value': v, /* required property */
'domain': '.58.com',
'path': '/', /* required property */
'httponly': false,
'secure': false,
'expires': (new Date()).getTime() + (1000 * 60 * 60)
}));
}
}
}
phantom.addCookie正确方法
最新推荐文章于 2023-06-28 19:46:29 发布