rod
  • 2024-10-29实验3
    task1#include<stdio.h>charscore_to_grade(intscore);//函数声明intmain(){intscore;chargrade;while(scanf("%d",&score)!=EOF){grade=score_to_grade(score);//函数调用printf("分数:%d,等级:
  • 2024-10-29实验三
    实验一:源代码:1#include<stdio.h>2charscore_to_grade(intscore);3intmain(){4intscore;5chargrade;67while(scanf("%d",&score)!=EOF){8grade=score_to_grade(score);9printf(&quo
  • 2024-10-22深入理解递归与递归实战
    递归的基本概念递归是一种强大的编程技术,它允许一个函数调用自身来解决问题。递归的基本思想是将复杂的问题分解成更小的子问题,直到问题足够简单可以直接解决为止。递归通常包含两个主要部分:基本情况(BaseCase):这是递归调用的结束条件,也就是最简单的情况,可以直接得到答案
  • 2024-03-25Go-Rod #3 Context and Timeout
    这个示例演示了如何设置超时操作。packagemainimport( "math/rand" "time" "github.com/go-rod/rod")funcmain(){ page:=rod.New().MustConnect().MustPage("https://github.com") page. //Seta5-secondtimeoutforallcha
  • 2024-03-24Go-Rod自用案例 #1 测试多组账号登录
    使用场景本样例用于在给定的HTML文件中(简单的登录注册),测试多组账号密码是否能够成功登录,并打印出登录结果。前端代码<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-
  • 2024-03-24Go-Rod #1 Basic
    这个例子是打开https://github.com/,搜索“git”,然后获取给出git描述的header元素。packagemainimport("fmt""github.com/go-rod/rod""github.com/go-rod/rod/lib/input")funcmain(){//Launchanewbrowserwithdefaultoptions,a
  • 2023-08-19动态规划--钢条切割问题
    博客地址:https://www.cnblogs.com/zylyehuo/#-*-coding:utf-8-*-importtimedefcal_time(func):defwrapper(*args,**kwargs):t1=time.time()result=func(*args,**kwargs)t2=time.time()print("%s
  • 2023-02-13go-rod 获得cookie
      sMap:=make(map[string]string)for_,cookie:=rangepage.MustCookies(){//log.Printf("chromecookie%d:%+v",i,co
  • 2023-02-13go-rod 设置等待,用js设置等待
       page.MustWait(`()=>{window.astr=Array.from(document.querySelectorAll('#noResult>div>div>p:nth-child(3)')).map(article=>article.inn
  • 2023-02-13go-rod 自定义启动
       u:=launcher.New().Headless(false).//Devtools(true).Bin("E:\\Chrome-bin\\chrome.exe").MustLaunch()browser:=rod.Ne
  • 2023-02-11go-rod 设置请求超时
        err:=rod.Try(func(){page.Timeout(60*time.Second).MustNavigate(url).MustWaitLoad().CancelTimeout()})iferrors.Is(err,
  • 2023-02-11go-rod 设置cookie
      expr:=proto.TimeSinceEpoch(time.Now().Add(180*24*time.Hour).Unix())page.MustSetCookies(&proto.NetworkCookieParam{Name:"cookiename"
  • 2023-01-26go-rod 在linux上启动
       ​​https://github.com/go-rod/go-rod-chinese/blob/186e2fcf0611f0fcea74e723d82e079bd724ce8f/lib/examples/launch-managed/main.go​​ 
  • 2023-01-26go-rod window环境设置浏览器宽高
         ​​https://github.com/go-rod/go-rod-chinese/blob/186e2fcf0611f0fcea74e723d82e079bd724ce8f/page_test.go​​ page.MustSetWindow(0,0,1211,611) 
  • 2023-01-14go-rod 读取cookie
      //readnetworkvaluesfori,cookie:=rangepage.MustCookies(){log.Printf("chromecookie%d:%+v",i,cookie)} 
  • 2023-01-14go-rod docker启动
        
  • 2023-01-12go-rod 读取cookie
       https://github.com/go-rod/go-rod-chinese/blob/186e2fcf0611f0fcea74e723d82e079bd724ce8f/lib/examples/compare-chromedp/cookie/main.go  //rea