Skip to content

Commit a50f4b0

Browse files
committed
chore: apply v0.4.1 changes to internals packages
1 parent d58e706 commit a50f4b0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

internal/actions/dm.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ func sendMessageWebDriver(bot *types.IGopher, user, message string) (bool, error
4040

4141
// Type and select user to dm
4242
if find, err := bot.SeleniumStruct.WaitForElement(
43-
"//*[@id=\"react-root\"]/section/div[2]/div/div[1]/div/div[2]/input", "xpath", 10); err == nil && find {
44-
elem, _ := bot.SeleniumStruct.GetElement("//*[@id=\"react-root\"]/section/div[2]/div/div[1]/div/div[2]/input", "xpath")
43+
"//section/div[2]/div/div[1]/div/div[2]/input", "xpath", 10); err == nil && find {
44+
elem, _ := bot.SeleniumStruct.GetElement("//section/div[2]/div/div[1]/div/div[2]/input", "xpath")
4545
log.Debug("Finded an retrieved user searchbar")
4646
if res := simulation.SimulateHandWriting(elem, user); !res {
4747
return false, errors.New("Error during user searching")

internal/actions/login.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ func connectToInstagramWebDriver(bot *types.IGopher) {
2020
}
2121
utils.RandomSleep()
2222
// Accept cookies if requested
23-
if find, err := bot.SeleniumStruct.WaitForElement("//button[text()='Accept All']", "xpath", 10); err == nil && find {
24-
elem, _ := bot.SeleniumStruct.GetElement("//button[text()='Accept All']", "xpath")
23+
if find, err := bot.SeleniumStruct.WaitForElement("//button[text()='Accept All' or text()='Allow essential and optional cookies']",
24+
"xpath", 10); err == nil && find {
25+
elem, _ := bot.SeleniumStruct.GetElement("//button[text()='Accept All' or text()='Allow essential and optional cookies']", "xpath")
2526
elem.Click()
2627
log.Debug("Cookies validation done!")
2728
} else {

internal/scrapper/scrapper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ func navigateUserFollowersList(bot *types.IGopher, srcUsername string) (bool, er
123123
}
124124
utils.RandomSleepCustom(1, 3)
125125
// Access to followers list view
126-
if find, err := bot.SeleniumStruct.WaitForElement("//*[@id=\"react-root\"]/section/main/div/ul/li[2]/a", "xpath", 10); err == nil && find {
127-
elem, _ := bot.SeleniumStruct.GetElement("//*[@id=\"react-root\"]/section/main/div/ul/li[2]/a", "xpath")
126+
if find, err := bot.SeleniumStruct.WaitForElement("//section/main/div/ul/li[2]/a", "xpath", 10); err == nil && find {
127+
elem, _ := bot.SeleniumStruct.GetElement("//section/main/div/ul/li[2]/a", "xpath")
128128
elem.Click()
129129
logrus.Debug("Clicked on user followers list")
130130
} else {

0 commit comments

Comments
 (0)