2

I am trying to devise a code that enables me to login a website https://www.change.org/login with the help of selenium in VBA. I am accustomed to that but as for this website, I found two groups of form and I can't specify the right direction for that When searching using CSS selector like that .grouped-form I found two groups. And I have tried many things but the same problem of finding two groups I even tried using XPath:

.FindElementByXPath("/html/body/div[2]/header/div[3]/div/div/div/form/div[1]/div[1]/div/span/input").SendKeys "yyyy"

but got an error.

I could solve it by using:

.FindElementByCss("#page .login input[name='email']").SendKeys "yakh777@gmail.com"

But I welcome more suggestions ..

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
YasserKhalil
  • 9,138
  • 7
  • 36
  • 95

1 Answers1

1

You can use either of the following Locator Strategies:

  • FindElementByXPath:

    FindElementByXPath("//div[@class='login-container']//input[@name='email']").SendKeys "yakh777@gmail.com"
    
  • FindElementByCss:

    FindElementByCss("div.login-container input[name='email']").SendKeys "yakh777@gmail.com"
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352