I need to click on the Ok button on a page (HTML code snippet hereunder). The button itself does not have an Id and its XPath changes. It can be any of the following: The only stable locator I can find in the page is the noresultsfound Id of the div before the div that contains the button as a
Tag: selenium
I have a wbpage where everytime based on start and end date the textboxes increase and decrease I am not getting proper row count and txtbox coun
This is the code iam using to count number of rows, it is returning only 1: tablen = driver.find_elements(By.XPATH, ‘//*[@id=”m_mc_s0_z0_C_ctl00_tblForecast”]/tbody/tr’) tblength = len(tablen) print(tblength) Result : it is printing output as 1, but their are many rows Answer Writing here in answer section as I have a snapshot to paste. Is your locator correct? I built hmtl of your code
Webscaping table data with drop down menu help in either Pandas, Beautiful Soup or Selenium
I am trying to scrape data from this website: https://www.shanghairanking.com/rankings/grsssd/2021 Initially pandas gets me out the gates and I can scrape the table but I am struggling with the drop down menus. I want to select the options next to the total score box which are PUB, CIT, etc. When I inspect the element it looks like maybe Javascript and
Download files without dialog window selenium
I have a cod. I have a docker + python + pytest + selenium + Chrome + selenium host and prefs But it doesn’t work. I want save to file without dialog window. But test don`t save files. How can I understand the reason? And… Downloading files works on Windows, but not docker on linux. P.S I have this path
WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 64 error using Selenium Geckodriver Firefox in FreeBSD jail
For some tests, I’ve set up a plain new TrueNAS 12.3 FreeBSD Jail and started it, then installed python3, firefox, geckodriver and pip using the following commands: Afterwards, when I want to use Selenium with Firefox in my Python code, it does not work: it brings Funnily, on another Jail that I’ve set up approximately a year ago (approximately in
Downloading images using src in python produces empty images
My script is kind of working but the files it saves are empty. Any ideas? Forgive me for all the unused import at the top! I tried a lot of different things to do this. In here I’m pulling the img using selenium. The SRCs are then iterated through a loop and transformed into bytes so that they can be
Selenium element.text() is not considered as a string
Im trying to get an element name with python selenium and print it later but it throws following error: Code line looks like this: HTML element looks like this: I tried searcing for element by XPath but it seems not to be a reason for error… Answer To get a web element text you should apply .text on it, not
Is it possible to locate element by partial class match in Selenium
I’m getting starting with Selenium and I’m trying to locate the Next button on the cnn site and if it isn’t the last page to click on it, otherwise to end the program. The html code for enabled button is: The html code for disabled button is: How should approach the solution? I tried is_enabled() or to find part of
How to make a loop that keeps cheking if theres a certain class
Hello I’m trying to make a loop that keeps searching for a class with “buy” and if it finds it needs to refresh until it can’t find it anymore and then it runs the rest of the code. I’m using selenium and python help would be much appreciated. Thanks in advance Answer While not true is the actual loop condition.
For loop with lot of different Urls
totally novice in python, after many youtube videos and tutorial i’m trying to scrape basketball starting lineups from flashscore. Here’s an example of a link: https://www.flashscore.it/partita/6PN3pAhq/#informazioni-partita/formazioni As you can see in the middle there’s a code (6PN3pAhq) that corresponds to a particular match: every match has a different one, i scraped all the results (144 matches at the moment) and