@@ -2,17 +2,71 @@ package main
2
2
3
3
import (
4
4
"context"
5
+ "github.com/chromedp/chromedp"
5
6
pkg "github.com/hktalent/scan4all/lib/crawlergo"
6
7
"log"
8
+ "time"
7
9
)
8
10
9
11
func main () {
12
+ //ctx := context.Background()
13
+ //x1 := pkg.GetChromedpInstace(&ctx)
14
+ ////n1 := 15 * time.Second
15
+ //n1 := 1000 * time.Second
16
+ //
17
+ //// Username already used
18
+ ////x1.DoUrl("https://google.com", &map[string]interface{}{"cookie": "xxx"}, nil)
19
+ //if err := x1.DoUrl("https://account.proton.me/signup?plan=free&billing=12&minimumCycle=12¤cy=undefined&language=en", &map[string]interface{}{}, &n1, func() *chromedp.Tasks {
20
+ // szPswd := ""
21
+ // return &chromedp.Tasks{
22
+ // chromedp.SetValue(`#email`, "hk_994", chromedp.ByID),
23
+ // chromedp.SetValue(`#password`, szPswd, chromedp.ByID),
24
+ // chromedp.SetValue(`#repeat-password`, szPswd, chromedp.ByID),
25
+ // chromedp.Click("main > div.sign-layout-main-content > form > button", chromedp.NodeReady),
26
+ // chromedp.Click("#html_element", chromedp.ByID),
27
+ // }
28
+ // // next:hk_994
29
+ // // main > div.sign-layout-main-content > form > button
30
+ // // 跳过手机号码
31
+ // // /html/body/div[1]/div[3]/div/div/main/div[2]/form/button[2]
32
+ //}); err != nil {
33
+ // log.Println(err)
34
+ //}
35
+ ////defer x1.Close()
36
+
37
+ RegGithub ()
38
+ }
39
+
40
+ // https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home
41
+ func RegGithub () {
10
42
ctx := context .Background ()
11
43
x1 := pkg .GetChromedpInstace (& ctx )
12
44
//n1 := 15 * time.Second
13
- //x1.DoUrl("https://google.com", &map[string]interface{}{"cookie": "xxx"}, nil)
14
- if err := x1 .DoUrl ("https://www.baidu.com" , & map [string ]interface {}{}, nil ); err != nil {
45
+ n1 := 1000 * time .Second
46
+
47
+ if err := x1 .DoUrl ("https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home" , & map [string ]interface {}{}, & n1 , func () * chromedp.Tasks {
48
+ szPswd := ""
49
+ return & chromedp.Tasks {
50
+ chromedp .
SetValue (
`#email` ,
"[email protected] " ,
chromedp .
ByID ),
51
+ chromedp .Sleep (2 * time .Second ),
52
+ chromedp .Click ("//*[@id=\" email-container\" ]/div[2]/button" , chromedp .NodeReady ),
53
+ chromedp .Sleep (2 * time .Second ),
54
+ chromedp .SetValue (`#password` , szPswd , chromedp .ByID ),
55
+ chromedp .Sleep (2 * time .Second ),
56
+ chromedp .Click (`document.querySelector("#password-container > div.d-flex.flex-items-center.flex-column.flex-sm-row > button")` , chromedp .ByJSPath ),
57
+ chromedp .Sleep (2 * time .Second ),
58
+ chromedp .SetValue (`#login` , "hk999999" , chromedp .ByID ),
59
+ chromedp .Sleep (2 * time .Second ),
60
+ chromedp .SetValue (`#opt_in` , "n" , chromedp .ByID ),
61
+ chromedp .Sleep (2 * time .Second ),
62
+ chromedp .Click (`document.querySelector("#opt-in-container > div.d-flex.flex-items-center.flex-column.flex-sm-row > button")` , chromedp .ByJSPath ),
63
+ }
64
+ // next:hk_994
65
+ // main > div.sign-layout-main-content > form > button
66
+ // 跳过手机号码
67
+ // /html/body/div[1]/div[3]/div/div/main/div[2]/form/button[2]
68
+ }); err != nil {
15
69
log .Println (err )
16
70
}
17
- defer x1 .Close ()
71
+ // defer x1.Close()
18
72
}
0 commit comments