fix windows quit

This commit is contained in:
eson
2020-08-04 14:12:00 +08:00
parent 93ec2e78a6
commit 826d15876a
3 changed files with 6 additions and 8 deletions

View File

@@ -51,7 +51,6 @@ func (cl *ChannelLink) Execute() {
var hrefs map[string]bool = make(map[string]bool)
var delayerror = 5
var samecount = 0
for i := 0; i <= 200; i++ {
cards, err := wd.FindElements(selenium.ByXPATH, "//span/a[contains(@data-a-target,'card-') and @href]")
if err != nil {
@@ -59,7 +58,7 @@ func (cl *ChannelLink) Execute() {
break
}
if len(cards) == samecount {
if len(hrefs) == 0 {
delayerror--
if delayerror <= 0 {
break
@@ -80,7 +79,7 @@ func (cl *ChannelLink) Execute() {
}
break
}
samecount = len(cards)
if ps.IsClose() {
break
}