Skip to content

Commit 9dc366e

Browse files
author
bajins
committed
fixed debug
1 parent 6392c0e commit 9dc366e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

reptile/Netsarang.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func SendMail(mail, product string) error {
5353
// 定义变量,用来保存爬虫的数据
5454
var res string
5555

56-
err := ApplyDebug(clickSubmitMail(url, mail, &res))
56+
err := ApplyRun(clickSubmitMail(url, mail, &res))
5757
if err != nil {
5858
return err
5959
}
@@ -170,7 +170,7 @@ func DownloadNetsarang(product string) (string, error) {
170170

171171
var attributes map[string]string
172172

173-
err = ApplyDebug(getDownloadUrl(tokenHtml.Text(), &attributes))
173+
err = ApplyRun(getDownloadUrl(tokenHtml.Text(), &attributes))
174174
if err != nil {
175175
return "", err
176176
}

reptile/chromedp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ func ApplyDebug(actions chromedp.Action) error {
6464
//}
6565
//defer os.RemoveAll(dir)
6666

67-
opts := append(chromedp.DefaultExecAllocatorOptions[:],
67+
opts := []chromedp.ExecAllocatorOption{
6868
// 设置UA,防止有些页面识别headless模式
6969
chromedp.UserAgent(UserAgent),
7070
// 窗口最大化
7171
chromedp.Flag("start-maximized", true),
72-
)
72+
}
7373
return Apply(actions, opts...)
7474
}
7575

0 commit comments

Comments
 (0)