Fixed year problem...

This commit is contained in:
2022-01-10 09:28:46 -06:00
parent acefe66f8e
commit d8c738241c
4 changed files with 37 additions and 9 deletions

View File

@@ -116,7 +116,11 @@ func (r *Runner) GetIntsaEgagement(urls []string) []InstaPost {
fmt.Print(".")
err = r.page.Navigate("https://www.instagram.com" + url)
}
r.page.MustWaitLoad()
err = r.page.Timeout(5 * time.Second).WaitLoad()
for err != nil {
fmt.Print(".")
err = r.page.Timeout(5 * time.Second).WaitLoad()
}
r.Scroll(10, 250)
data := r.page.MustEval(instagram_post_data).JSON("", "")
@@ -145,8 +149,7 @@ func (r *Runner) GetIntsaEgagement(urls []string) []InstaPost {
if res.Views != 0 {
res.Type = "Video"
//res.Engagement = res.Views + res.Comments
res.Engagement = 0
res.Engagement = res.Likes + res.Comments
} else {
res.Type = "Image"
res.Engagement = res.Likes + res.Comments