Relative Content

Tag Archive for pythonselenium-webdriver

Webpage Only Scrolls Once Using Selenium Despite New Content Loading

I’m trying to scrape URLs from a dynamically allocated webpage that requires continuous scrolling to load all the content into the DOM. My approach involves running window.scrollTo(0, document.body.scrollHeight); in a loop using Selenium’s execute_script function. After each scroll, I compare the number of URLs loaded before and after the scroll. If the number of URLs doesn’t change, I assume the end of the page has been reached and break the loop.

Selenium is not able to click on menu button on SEC.gov page

I’m trying to get an href link to download an XBRL file for a 10-Q financial report from an SEC webpage. Selenium is able to open the webpage but then it must click on the menu button in the top left to expand the menu to get to the ‘Save XBRL Zip File’ button but fails to do so. When I run my code, the TimeoutException is raised, no matter how much waiting time is specified. The XPATH is the one selected by the element selector when I inspect the html of the opened webpage. I am very new to programming. I found similar questions but the answers did not solve my issue. Any help is greatly appreciated!

.get_attribute() is taking too long

While trying to get a minesweeper board currently on screen, I use the following skript which repeatedly uses the get_attribute() function. This however is incredibly slow:

Clicking Button on Selenium/Python

I’m currently trying to build out an automation that requires selecting on a button from a pop up screen but I’ve been unsuccessful. There are two buttons and the one I’m wanting to select is the “Save” portion. Here is currently how the code looks like for the button: