web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to Scroll a Spe...
Power Automate
Unanswered

Unable to Scroll a Specific Part of a Webpage Using JavaScript

(1) ShareShare
ReportReport
Posted on by 4

Hello everyone,

I’m currently working on automating a task to scroll through a specific section of a LinkedIn page, and I’m running into some challenges. I’ve attempted several JavaScript-based approaches to achieve this, but none have worked so far. Here’s what I’ve tried:

  1. Using JavaScript for Webpage Actions:
    I wrote multiple scripts to programmatically scroll the element with the specified class. For example, I used methods like scrollTop and scrollIntoView. Unfortunately, none of these scripts scrolled the section as expected.

  2. Focusing on the Last Element:
    I tried selecting the last element within the target section and using scrollIntoView() to focus on it and also Focus on text action. However, it keeps showing an error stating that the element cannot be found.

  3. Mouse Move Action:
    I attempted to simulate a mouse move action within the section to scroll, but it didn’t produce any results. I suspect this might be due to LinkedIn’s dynamic loading or event handling.

 

If anyone has successfully implemented a solution to scroll a specific part of a webpage with similar constraints, I’d greatly appreciate your guidance. Are there any specific JavaScript methods, browser extensions, or tools that can help in this scenario?

I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    Hello,

    Can you explain a bit more what is your goal? Is it to scroll through slowly that list of emails or to go to the end of the list?

    Have you tried with send keys like arrow key down/page down/end? So first focus on the element section (maybe click the first email) and then use send keys. 

    I tried with this on my outlook email list in browser and it worked:
    function ExecuteScript() {
        const scrollSpeed = 5; // Pixels per step
        const delay = 10; // Milliseconds between steps
        const targetElement = document.querySelector("[class^='customScrollBar']"); // Select element with class starting with 'customScrollBar'
    
        if (!targetElement) {
            console.error("Element with class starting with 'customScrollBar' not found.");
            return;
        }
    
        function scrollStep() {
            targetElement.scrollBy(0, scrollSpeed);
            if (targetElement.scrollHeight - targetElement.scrollTop > targetElement.clientHeight) {
                setTimeout(scrollStep, delay);
            }
        }
    
        scrollStep();
        return "end" //just so Result returns something other than object Obect
        }
    That scrolls the list pretty smoothly.
     
    It could be that you need to change the querySelector:
        const targetElement = document.querySelector("[class^='customScrollBar']"); // Select element with class starting with 'customScrollBar'
    so check which is the correct element for you to scroll down. For me it was element with a class that starts with the text "customScrollBar"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard