File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change @@ -128,15 +128,33 @@ func DownloadNetsarang(product string) (string, error) {
128128 time .Sleep (20 * time .Second )
129129
130130 mailList := LinShiYouXiangList (prefix )
131-
131+ //for mailList == "" {
132+ // if mailList != "" {
133+ // break
134+ // }
135+ // time.Sleep(20 * time.Second)
136+ // mailList = LinShiYouXiangList(prefix)
137+ //}
138+ //GETMAIL:
139+ // if mailList == "" {
140+ // time.Sleep(20 * time.Second)
141+ // mailList = LinShiYouXiangList(prefix)
142+ // goto GETMAIL
143+ // }
144+ for i := 0 ; i < 10 ; {
145+ if mailList != "" {
146+ break
147+ }
148+ time .Sleep (20 * time .Second )
149+ mailList = LinShiYouXiangList (prefix )
150+ }
132151 var list []map [string ]interface {}
133152 err = json .Unmarshal ([]byte (mailList ), & list )
134153 if err != nil {
135154 return "" , err
136155 }
137156 listLen := len (list )
138157 if listLen == 0 {
139- log .Println (list )
140158 return "" , errors .New ("没有邮件" )
141159 }
142160 mailbox := list [listLen - 1 ]["mailbox" ].(string )
Original file line number Diff line number Diff line change @@ -83,11 +83,9 @@ func ApplyRun(actions chromedp.Action) error {
8383
8484 opts := append (chromedp .DefaultExecAllocatorOptions [:],
8585 chromedp .NoDefaultBrowserCheck ,
86- // 无头模式
87- chromedp .Flag ("headless" , false ),
88- //chromedp.Headless,
86+ chromedp .Headless ,
8987 // 禁用GPU,不显示GUI
90- // chromedp.DisableGPU,
88+ chromedp .DisableGPU ,
9189 // 隐身模式启动
9290 chromedp .Flag ("incognito" , true ),
9391 // 取消沙盒模式
@@ -105,7 +103,7 @@ func ApplyRun(actions chromedp.Action) error {
105103 // 禁用扩展
106104 chromedp .Flag ("disable-extensions" , true ),
107105 // 隐藏滚动条, 应对一些特殊页面
108- // chromedp.Flag("hide-scrollbars", true),
106+ chromedp .Flag ("hide-scrollbars" , true ),
109107 // 设置UA,防止有些页面识别headless模式
110108 chromedp .UserAgent (UserAgent ),
111109 // 设置用户数据目录
You can’t perform that action at this time.
0 commit comments