Skip to content

Commit

Permalink
fix: browser stuck after connexion on /#reactivated url
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Jan 30, 2022
1 parent 2be277b commit b47e1b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ func (bot *IGopher) connectToInstagramWebDriver() {
"//*[@aria-label='Home'] | //button[text()='Save Info'] | //button[text()='Not Now']") {
log.Info("Login Successful!")
} else {
log.Warnf("Instagram does not ask for informations saving, the login process may have failed.")
if err := bot.SeleniumStruct.WebDriver.Refresh(); err != nil {
bot.SeleniumStruct.Fatal("Can't refresh page: ", err)
}
if find, err := bot.SeleniumStruct.WaitForElement("//*[@aria-label='Home'] | //*[text()='Save Info'] | //*[text()='Not Now']",
"xpath", 10); err != nil || !find {
log.Warnf("Instagram does not ask for informations saving or app download, the login process may have failed.")
}
}
}

Expand Down

0 comments on commit b47e1b8

Please sign in to comment.