inputs being filled in too fast in selenium | python 3.8

so I am trying to log into this website called ttrockstars, and I have written a function to login to the website. However the code seems to be running too fast and ignoring time.sleep(5) that i have added to the code: When I run this, it simply enters the school name and then deletes it and enters the username and then brings up an error saying the password box does not exist. This would not be a problem if it actually submitted the school and waited 5 seconds. Why is this happening and is there a workaround? Answer These are

pycharm python selenium scraper apparently not printing correct value

I new to python, selenium, pycharm and such. I’m trying to print the value of a on a website ( at the moment of writing this the value is 6320 ).The code is not giving errors but it’s printing nothing. As you can see in the screenshot, when i’m debugging and hovering over the variable, it’s displaying 6320, which is the value i’m looking for. What am I doing wrong? Thanks a lot for your help! Answer You need wait until .visibility_of_element_located and use this xpath: //td[contains(., “Total*”)]//span[last()], although your xpath also works, but it is an absolute xpath that

How do I run through a list of links one by one and then scrape data using selenium(driver.get)?

I’m trying to loop through 2 sets of links. Starting with https://cuetracker.net/seasons > click through each season link (Last 5 seasons) and then click through each tournament link within each season link and scrape the match data from each tournament. Using the below code I have managed to get a list of season links I desire but then when I try and grab the tournament links and put them into a list it is only getting the last season tournament links as opposed to each season’s. I’d guess it’s something to do with driver.get just completing before the next lines

Python and Selenium – Pick value from dropdown list

Trying to pick value in the dropwdown list as shown in picture – Dresses Dropdown IMAGE with open HTML By this line i’m able to click and expand the dropdown After i expand the dropdown list i tried to pick xPath/CSS selector for Dresses but nothing works How i copy the Selector Answer Induce WebDriverWait() and element_to_be_clickable() and click on first dropdown div tag to expand and the click on the dropdown item.Hope this will work. Update

Selenium Chromedriver error chome not reachable but driver get works

I am trying to get the page content from a webpage, with the use of selenium and chromedriver. I am using an Ubuntu 18.04 subsystem on Windows. The driver.get method works, but getting the page content does not. Here is my code: Here is my error: Don’t really know what to do anymore, I tried changing chromedriver versions, maybe the problem is using a subsystem but I am not sure. Answer Try with : executable_path with “absolute_path..upto..driver-EXE” not only a directory. for example: I have already tested using Pycharm IDE same above code working fine. Thanks… Enjoy coding…

How to find element by part of its id name in selenium with python

I’m using selenium with python,now I want to locate an element by part of its id name,what can I do? For example,now I’ve already located a item by id name coption5 : Is there anyway I can locate this element only by using coption? Answer To find the element which you have located with: To locate this element only by using coption you can use can use either of the following Locator Strategies: Using XPATH and starts-with(): Using XPATH and contains(): Using CSS_SELECTOR and ^ (wildcard of starts-with): Using CSS_SELECTOR and * (wildcard of contains): Reference You can find a

How to send text to the Email field within https://accounts.google.com registration page?

I made proton mail maker script that can go to google sign in and put verification code to proton mail code section.. when I run that, it’s working correctly but it’s not typing google account for signing but he is not typing in the email section I had an error in google account email section here is my error: python code Answer You have to switch to the new window before interacting with the elements on the new window. Use the below line of code to switch to the latest window. Once you are done with the actions on the

How to get selectors with dynamic part inside using Selenium with Python?

My application has a lot of selectors that have a dynamic ID inside. When that dynamic ID is at the end of the selector, I use [id^=’staticPart’] inside of every selector. For example: becomes: I works perfectly, but I can’t figure out what to do with selectors like this: where 0 is a dynamic number and everything else is static. I am trying the following, but I get an invalid selector error: Answer To identify an element with dynamic id e.g. #tab-t0-1 where 0 is a dynamic number and everything else is static you can use cssSelector with the following

How to use Selenium with Python?

How do I set up Selenium to work with Python? I just want to write/export scripts in Python, and then run them. Are there any resources for that? I tried googling, but the stuff I found was either referring to an outdated version of Selenium (RC), or an outdated version of Python. Answer You mean Selenium WebDriver? Huh…. Prerequisite: Install Python based on your OS Install with following command And use this module in your code You can also use many of the following as required Here is an updated answer I would recommend you to run script without IDE…