go-rod 设置cookie

 

 

expr := proto.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour).Unix())

page.MustSetCookies(&proto.NetworkCookieParam{
        Name:     "cookiename",
        Value:    "value",
        Domain:   ".hostname.com",
        HTTPOnly: false,
        Expires:  expr,
    })

 

posted @ 2023-02-11 13:41  AngDH  阅读(94)  评论(0编辑  收藏  举报