Skip to content

Commit f96cbf1

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 28f31d8 + 9d6f751 commit f96cbf1

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-te
182182
* `--form-keyword-values, -fkv` Customize the value of the form fill, set by keyword fuzzy match. The keyword matches the four attribute values of `id`, `name`, `class`, `type` of the input box label. For example, fuzzy match the pass keyword to fill 123456 and the user keyword to fill admin, `-fkv user=admin -fkv pass=123456`. (Default: Cralwergo)
183183

184184
### Advanced settings for the crawling process
185-
* `--incognito-context, -i` Browser start incognito mode. (Default: true)
186185
* `--max-tab-count Number, -t Number` The maximum number of tabs the crawler can open at the same time. (Default: 8)
187186
* `--tab-run-timeout Timeout` Maximum runtime for a single tab page. (Default: 20s)
188187
* `--wait-dom-content-loaded-timeout Timeout` The maximum timeout to wait for the page to finish loading. (Default: 5s)

README_zh-cn.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ crawlergo 拥有灵活的参数配置,以下是详细的选项说明:
114114
* `--filter-mode Mode, -f Mode` 过滤模式,简单:只过滤静态资源和完全重复的请求。智能:拥有过滤伪静态的能力。严格:更加严格的伪静态过滤规则。
115115
* `--output-mode value, -o value` 结果输出模式,`console`:打印当前域名结果。`json`:打印所有结果的json序列化字符串,可直接被反序列化解析。`none`:不打印输出。
116116
* `--output-json filepath` 将爬虫结果JSON序列化之后写入到json文件。
117-
* `--incognito-context, -i` 浏览器启动隐身模式
118117
* `--max-tab-count Number, -t Number` 爬虫同时开启最大标签页,即同时爬取的页面数量。
119118
* `--fuzz-path` 使用常见路径Fuzz目标,获取更多入口。
120119
* `--fuzz-path-dict` 通过字典文件自定义Fuzz目录,传入字典文件路径,如:`/home/user/fuzz_dir.txt`,文件每行代表一个要fuzz的目录。

cmd/crawlergo/flag.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ func SetChromePath() *cli.PathFlag {
4040
Name: "chromium-path",
4141
Aliases: []string{"c"},
4242
Usage: "`Path` of chromium executable. Such as \"/home/test/chrome-linux/chrome\"",
43-
Required: true,
4443
Destination: &taskConfig.ChromiumPath,
4544
EnvVars: []string{"CRAWLERGO_CHROMIUM_PATH"},
4645
}

pkg/engine/browser.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ func InitBrowser(chromiumPath string, extraHeaders map[string]interface{}, proxy
2525
var bro Browser
2626
opts := append(chromedp.DefaultExecAllocatorOptions[:],
2727

28-
// 执行路径
29-
chromedp.ExecPath(chromiumPath),
3028
// 无头模式
3129
chromedp.Flag("headless", !noHeadless),
3230
// https://github.com/chromedp/chromedp/issues/997#issuecomment-1030596050
@@ -59,6 +57,12 @@ func InitBrowser(chromiumPath string, extraHeaders map[string]interface{}, proxy
5957
opts = append(opts, chromedp.ProxyServer(proxy))
6058
}
6159

60+
if len(chromiumPath) > 0 {
61+
62+
// 指定执行路径
63+
opts = append(opts, chromedp.ExecPath(chromiumPath))
64+
}
65+
6266
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
6367
bctx, _ := chromedp.NewContext(allocCtx,
6468
chromedp.WithLogf(log.Printf),

0 commit comments

Comments
 (0)