mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 09:19:41 +08:00
fix: try to find and close popups when get trackings failed
This commit is contained in:
@@ -147,11 +147,16 @@ func (vc *VideoCrawler) startLiveCrawler(enterPoint PointF) error {
|
|||||||
// failed 3 consecutive times
|
// failed 3 consecutive times
|
||||||
return errors.New("get current live event trackings failed 3 consecutive times")
|
return errors.New("get current live event trackings failed 3 consecutive times")
|
||||||
}
|
}
|
||||||
|
log.Warn().Int64("failedCount", vc.failedCount).
|
||||||
|
Msg("get current live room failed")
|
||||||
|
|
||||||
|
// check and handle popups
|
||||||
|
if err := vc.driverExt.ClosePopupsHandler(WithMaxRetryTimes(3)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// retry
|
// retry
|
||||||
vc.failedCount++
|
vc.failedCount++
|
||||||
log.Warn().
|
|
||||||
Int64("failedCount", vc.failedCount).
|
|
||||||
Msg("get current live room failed")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,21 +268,16 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
|
|||||||
return errors.New("get current feed video failed 10 consecutive times")
|
return errors.New("get current feed video failed 10 consecutive times")
|
||||||
}
|
}
|
||||||
log.Warn().Msg("get current feed video failed")
|
log.Warn().Msg("get current feed video failed")
|
||||||
|
|
||||||
|
// check and handle popups
|
||||||
|
if err := crawler.driverExt.ClosePopupsHandler(WithMaxRetryTimes(3)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// retry
|
// retry
|
||||||
crawler.failedCount++
|
crawler.failedCount++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if feedVideo.VideoID == crawler.lastVideo.VideoID &&
|
|
||||||
feedVideo.CacheKey == crawler.lastVideo.CacheKey &&
|
|
||||||
feedVideo.UserName == crawler.lastVideo.UserName {
|
|
||||||
// app event tracking not changed
|
|
||||||
// check and handle popups
|
|
||||||
log.Warn().Msg("feed video event tracking not changed")
|
|
||||||
if err = crawler.driverExt.ClosePopupsHandler(WithMaxRetryTimes(1)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
crawler.lastVideo = feedVideo
|
crawler.lastVideo = feedVideo
|
||||||
|
|
||||||
screenResult := &ScreenResult{
|
screenResult := &ScreenResult{
|
||||||
|
|||||||
Reference in New Issue
Block a user