【求助】Go爬虫无法获取北邮人论坛cookie的疑惑

freezer-glp · · 1270 次点击
貌似go解析Set-Cookie时认为 [ 是无效的字符,所以httpResp.Cookies()返回空,下面是把httpResp整个打印出来获取的Set-Cookie header: "Set-Cookie":[]string{"nforum[UTMPUSERID]=guest; path=/; domain=bbs.byr.cn", "nforum[UTMPKEY]=21970208; path=/; domain=bbs.byr.cn", "nforum[UTMPNUM]=29282; path=/; domain=bbs.byr.cn", "nforum[UTMPUSERID]=guest; path=/; domain=bbs.byr.cn", "nforum[UTMPKEY]=21970208; path=/; domain=bbs.byr.cn", "nforum[UTMPNUM]=29282; path=/; domain=bbs.byr.cn"} 下面是go解析cookie时依照的RFC标准: <http://tools.ietf.org/html/rfc6265 > cookie-pair = cookie-name "=" cookie-value cookie-name = token cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E ; US-ASCII characters excluding CTLs, ; whitespace DQUOTE, comma, semicolon, ; and backslash token = 1*<any CHAR except CTLs or separators> separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT
#3
更多评论
试试其他网站可以吗?
#1
手动捕获Cookies再Add进去
#2