3232
This commit is contained in:
parent
1c9ce20f4a
commit
9c22a1dc07
|
|
@ -279,14 +279,7 @@ func (b *BaseCollector) InitPage() error {
|
||||||
if err := b.LoadCookies(); err == nil {
|
if err := b.LoadCookies(); err == nil {
|
||||||
b.Page.MustNavigate(b.ChatURL)
|
b.Page.MustNavigate(b.ChatURL)
|
||||||
b.WaitForPageReady(5)
|
b.WaitForPageReady(5)
|
||||||
b.Sleep(2)
|
|
||||||
} else {
|
|
||||||
// 首次访问,先导航到页面
|
|
||||||
b.Page.MustNavigate(b.ChatURL)
|
|
||||||
b.WaitForPageReady(5)
|
|
||||||
b.Sleep(2)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
b.SaveCookies()
|
b.SaveCookies()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,6 @@ func (c *WenxinCollector) AskQuestion(question string) (*CollectResult, error) {
|
||||||
return nil, fmt.Errorf("页面初始化失败: %v", err)
|
return nil, fmt.Errorf("页面初始化失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Sleep(3)
|
|
||||||
|
|
||||||
if err := c.inputQuestion(question); err != nil {
|
if err := c.inputQuestion(question); err != nil {
|
||||||
return nil, fmt.Errorf("输入问题失败: %v", err)
|
return nil, fmt.Errorf("输入问题失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
@ -147,7 +145,6 @@ func (c *WenxinCollector) inputQuestion(question string) error {
|
||||||
inputSelectors := []string{
|
inputSelectors := []string{
|
||||||
"[contenteditable='true']",
|
"[contenteditable='true']",
|
||||||
"div[contenteditable]",
|
"div[contenteditable]",
|
||||||
".editable__T7WAW4uW",
|
|
||||||
"[class*='editable']",
|
"[class*='editable']",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue