会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
AngDH
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
34
35
36
37
38
39
40
41
42
···
124
下一页
2023年2月14日
css如何设置元素不显示仅占位置?
摘要: https://www.lmonkey.com/t/oREQWq1L1
阅读全文
posted @ 2023-02-14 10:30 AngDH
阅读(81)
评论(0)
推荐(0)
c 指针的指针
摘要:
阅读全文
posted @ 2023-02-14 01:15 AngDH
阅读(18)
评论(0)
推荐(0)
2023年2月13日
go-rod 获得cookie
摘要: sMap := make(map[string]string) for _, cookie := range page.MustCookies() { //log.Printf("chrome cookie %d: %+v", i, cookie) sMap[cookie.Name] = cooki
阅读全文
posted @ 2023-02-13 18:52 AngDH
阅读(206)
评论(0)
推荐(0)
go-rod 设置等待,用js设置等待
摘要: page.MustWait(`() => { window.astr = Array.from(document.querySelectorAll('#noResult > div > div > p:nth-child(3)')).map( article=>article.innerHTML).
阅读全文
posted @ 2023-02-13 18:18 AngDH
阅读(116)
评论(0)
推荐(0)
go-rod 自定义启动
摘要: u := launcher.New(). Headless(false). //Devtools(true). Bin("E:\\Chrome-bin\\chrome.exe").MustLaunch() browser := rod.New().ControlURL(u). //Trace(tru
阅读全文
posted @ 2023-02-13 16:16 AngDH
阅读(315)
评论(0)
推荐(0)
go-rod 判断某个元素存在
摘要: if page.MustHas("button#onetrust-accept-btn-handler") { page.MustElementX("//button[@id=\"onetrust-accept-btn-handler\"]").MustClick() }
阅读全文
posted @ 2023-02-13 16:14 AngDH
阅读(129)
评论(0)
推荐(0)
go 简单post请求
摘要: json 请求 client := &http.Client{} data := make(map[string]interface{}) data["key_name"] = key_name data["value_name"] = key_value bytesData, _ := json.
阅读全文
posted @ 2023-02-13 16:10 AngDH
阅读(64)
评论(0)
推荐(0)
2023年2月11日
go-rod 设置cookie
摘要: expr := proto.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour).Unix()) page.MustSetCookies(&proto.NetworkCookieParam{ Name: "cookiename", Value: "v
阅读全文
posted @ 2023-02-11 13:41 AngDH
阅读(163)
评论(0)
推荐(0)
go-rod 用js获取页面内容
摘要: result := page.MustEval(`() => Array.from(document.getElementsByTagName('body')).map(article=>article.innerHTML).join("\n")`)
阅读全文
posted @ 2023-02-11 13:39 AngDH
阅读(148)
评论(0)
推荐(0)
go-rod 设置请求超时
摘要: err := rod.Try(func() { page.Timeout(60 * time.Second).MustNavigate(url).MustWaitLoad().CancelTimeout() }) if errors.Is(err, context.DeadlineExceeded)
阅读全文
posted @ 2023-02-11 13:36 AngDH
阅读(234)
评论(0)
推荐(0)
上一页
1
···
34
35
36
37
38
39
40
41
42
···
124
下一页
公告