diff --git a/actions.go b/actions.go index 244920d..69c3ab1 100644 --- a/actions.go +++ b/actions.go @@ -114,8 +114,8 @@ func (bot *IGopher) sendMessageWebDriver(user, message string) (bool, error) { // Type and select user to dm if find, err := bot.SeleniumStruct.WaitForElement( - "//*[@id=\"react-root\"]/section/div[2]/div/div[1]/div/div[2]/input", "xpath", 10); err == nil && find { - elem, _ := bot.SeleniumStruct.GetElement("//*[@id=\"react-root\"]/section/div[2]/div/div[1]/div/div[2]/input", "xpath") + "//section/div[2]/div/div[1]/div/div[2]/input", "xpath", 10); err == nil && find { + elem, _ := bot.SeleniumStruct.GetElement("//section/div[2]/div/div[1]/div/div[2]/input", "xpath") log.Debug("Finded an retrieved user searchbar") if res := SimulateHandWriting(elem, user); !res { return false, errors.New("Error during user searching") diff --git a/scrapping.go b/scrapping.go index 7cd660d..8b376bc 100644 --- a/scrapping.go +++ b/scrapping.go @@ -129,8 +129,8 @@ func (sc *IGopher) navigateUserFollowersList(srcUsername string) (bool, error) { } randomSleepCustom(1, 3) // Access to followers list view - if find, err := sc.SeleniumStruct.WaitForElement("//*[@id=\"react-root\"]/section/main/div/ul/li[2]/a", "xpath", 10); err == nil && find { - elem, _ := sc.SeleniumStruct.GetElement("//*[@id=\"react-root\"]/section/main/div/ul/li[2]/a", "xpath") + if find, err := sc.SeleniumStruct.WaitForElement("//section/main/div/ul/li[2]/a", "xpath", 10); err == nil && find { + elem, _ := sc.SeleniumStruct.GetElement("//section/main/div/ul/li[2]/a", "xpath") elem.Click() logrus.Debug("Clicked on user followers list") } else {