Scroll down Google Maps

FASTMAN2023

New member
Joined
Feb 11, 2023
Messages
1
Programming Experience
3-5
how to Scroll down Google Maps to show all items and return to the first item?? I tried more than one using Selenium and Google Drive 109.0.5414.74/ . All attempts were unsuccessful. The scroll down only one centimeter and not to the last element. I don't know what the problem is.

C#:
 foreach (var item in driver.FindElements(By.XPath("//*[@id='QA0Szd']/div/div/div[1]/div[2]/div/div[1]/div/div/div[2]/div[1]"))) {

            driver.FindElement(By.XPath("//*[@id='QA0Szd']/div/div/div[1]/div[2]/div/div[1]")).Click();
            Actions actions = new Actions(driver);
            actions.SendKeys(OpenQA.Selenium.Keys.PageDown).Build().Perform();
       
        }
Another try:
foreach (var item in driver.FindElements(By.XPath("//*[@id='QA0Szd']/div/div/div[1]/div[2]/div/div[1]/div/div/div[2]/div[1]")))
            {

          
                var elem = driver.FindElement(By.XPath("//*[@id='QA0Szd']/div/div/div[1]/div[2]/div/div[1]"));
              
                driver.ExecuteScript("arguments[0].scrollIntoView(true);", elem);
              
            }
 
Seems more like a Selenium question, rather than a C# question...

Moving out of VS.NET General forum.
 
Back
Top Bottom