Skip to content

Commit

Permalink
fix: issue with new cookie validation popup
Browse files Browse the repository at this point in the history
  • Loading branch information
hbollon committed Mar 21, 2022
1 parent b220352 commit 812551a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ func (bot *IGopher) connectToInstagramWebDriver() {
}
randomSleep()
// Accept cookies if requested
if find, err := bot.SeleniumStruct.WaitForElement("//button[text()='Accept All']", "xpath", 10); err == nil && find {
elem, _ := bot.SeleniumStruct.GetElement("//button[text()='Accept All']", "xpath")
if find, err := bot.SeleniumStruct.WaitForElement("//button[text()='Accept All' or text()='Allow essential and optional cookies']",
"xpath", 10); err == nil && find {
elem, _ := bot.SeleniumStruct.GetElement("//button[text()='Accept All' or text()='Allow essential and optional cookies']", "xpath")
elem.Click()
log.Debug("Cookies validation done!")
} else {
Expand Down

0 comments on commit 812551a

Please sign in to comment.