Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9272343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:51:13+00:00 2026-06-18T15:51:13+00:00

I have a website which generates more products when I scroll down. Unlike other

  • 0

I have a website which generates more products when I scroll down. Unlike other websites, there is nothing found in the firebug console. So, I am using selenium to simulate a browser. I have made it working but with firefox driver. But, since I am hosting my web server which runs on command line, I am using HTMLUNIT. Can someone tell me how to scroll pages using HTMLUNIT? Here is the code till now:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

browser = webdriver.Remote("http://127.0.0.1:4444/wd/hub",desired_capabilities=webdriver.DesiredCapabilities.HTMLUNITWITHJS)
browser.get("http://www.somewebsite.com/")
x = browser.find_elements_by_xpath("//div[@id='containeriso3']/div/a[1]")
hrefs = [i.get_attribute('href') for i in x]
print len(hrefs)
time.sleep(2)
browser.execute_script("scroll(0, 2500);")
time.sleep(2)
x = browser.find_elements_by_xpath("//div[@id='containeriso3']/div/a[1]")
hrefs = [i.get_attribute('href') for i in x]
print len(hrefs)

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:51:15+00:00Added an answer on June 18, 2026 at 3:51 pm

    You can use JavaScript to scroll. From the docs:

    You can use the execute_script method to execute javascript on the loaded page.
    So, you can call the JavaScript API to scroll to the bottom or any other position of a page.

    Here is an example to scroll to the bottom of a page:

    driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
    

    The window object in DOM has a scrollTo method to scroll to any position of an opened window.
    The scrollHeight is a common property for all elements. The document.body.scrollHeight will give the height
    of the entire body of the page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From my website, I have a button which calls a method and then generates
I have a dynamic website which generates the product pages dynamically from imported data.
I have a website running in Microsoft SharePoint which uses menus and other data
I have a quite large website, in which there is a forum powered by
For example, I have a website which has a dynamically-generated segment of its dom
I have a website which using active directory authorization on a windows server in
I have a website which contains a large (and wide) table. The table is
I have a website which has a lot of combo boxes and auto-complete textboxes
I have a website which displays a lot of photos, built with asp.net and
I have a website which sells a product to the user (downloadable). I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.