drop-down-menu

Python Selenium – Select Options not returning all the options

Python Selenium – Select Options not returning all the options Question: I’ve been trying to use Python and Selenium to scrape some prices off a certain website The script I wrote seems to work well but sometimes I get an error on this part of the code : #Select "Date de début" select = Select(driver.find_element("xpath",’//*[@id="startDateSet"]’)) …

Total answers: 1

How to locate the pagination select button using Python Selenium

How to locate the pagination select button using Python Selenium Question: Code trials: from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.common.by import By from bs4 import BeautifulSoup import pandas as pd driver = webdriver.Firefox() url = r"https://www.nba.com/stats/players/advanced" driver.get(url) select = Select(driver.find_element(By.XPATH, r"/html/body/div[2]/div[2]/div[2]/div[3]/section[2]/div/div[2]/div[2]/div[1]/div[3]/div/label/div/select")) select.select_by_index(0) No matter everything I try I cannot find this full …

Total answers: 2

Unable to select the element in a list

Unable to select the element in a list Question: from selenium import webdriver import time from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import Select from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.remote.webelement import WebElement driver = webdriver.Chrome(‘chromedriver’) driver.get(‘https://devbusiness.tunai.io/login’) time.sleep(2) driver.maximize_window() # Create variables for login credentials. username = driver.find_element(By.NAME, "loginUsername"); …

Total answers: 1

Selecting page number from dropdown using Selenium python

Selecting page number from dropdown using Selenium python Question: I am attempting to change the page number to page 2 from the default of page 1 on https://stats.oecd.org/Index.aspx?DataSetCode=REVDEU Currently my code opens the page, and seemingly does nothing, eventually timing out. from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC …

Total answers: 1

selenium python element select from dropdown menu

selenium python element select from dropdown menu Question: Trying to select multiple elements from dropdown menu via selenium in python. Website from URL. But Timeoutexception error is occurring. I have tried Inspect menu from GoogleChrome. //label[@for="inputGenre"]/parent::div//select[@placeholder="Choose a Category"] gives exactly the select tag that I need. But unfortunately, with selenium I cannot locate any element …

Total answers: 1

Dropdown menu button doesn't update the plotly timeline plot

Dropdown menu button doesn't update the plotly timeline plot Question: I am trying to build a dropdown menu for plotly timeline plot. Here is my code: import pandas as pd import plotly.express as px def main(): d = { ‘T_ID’: [‘T1’, ‘T2’, ‘T3’, ‘T1’], ‘TYPE’: [‘Type1’, ‘Type2’, ‘Type3’, ‘Type2’], ‘SYS_START_TIME’: [‘2021-06-20 06:05’, ‘2021-06-23 15:13’, ‘2021-06-27 …

Total answers: 2

Python – Selenium – Select Dropdown

Python – Selenium – Select Dropdown Question: I am trying to select a dropdown box. The code from the page is: <span class="sui-dropdown" tabindex="0" style="width: 150px;"> <select class="dropdown-soberanos-plazo" style="display: none;"> <option value="CI">CI</option><option value="24hs">24hs</option> <option value="48hs">48hs</option> </select> <span class="sui-input sui-unselectable" unselectable="on">48hs</span> <span class="sui-caret-container sui-unselectable" unselectable="on"> <span class="sui-caret sui-unselectable" unselectable="on"> </span></span></span> I tried the next code, but …

Total answers: 2

Python, pysimplegui, combine Text and ButtonMenu resulting in an array

Python, pysimplegui, combine Text and ButtonMenu resulting in an array Question: I have a python recipe app utilizing pysimplegui. I want to fill in an ingredient and then have a dropdown for the amount of the ingredient, ie. 2 tbs, 1.5 tbs, 1 tbs, …etc. Currently my layout is: layout = [ [sg.Text(‘Name’, size=(15,1)), sg.InputText(key=’dish_name’)], …

Total answers: 1

Plotly python : how to make a dropdown menu with several lines?

Plotly python : how to make a dropdown menu with several lines? Question: I would like to make a dropdown menu in a plotly line graph such as the one in this post but with several lines. Let’s take a sample dataframe : import pandas as pd df = pd.DataFrame({"Date": ["2022-10-01","2022-10-02","2022-10-03","2022-10-01","2022-10-02","2022-10-03","2022-10-01","2022-10-02","2022-10-03","2022-10-01","2022-10-02","2022-10-03"], "Animal" :["Cat","Cat","Cat","Cat","Cat","Cat","Dog","Dog","Dog","Dog","Dog","Dog"], "Category":["Small","Small","Small","Big","Big","Big","Small","Small","Small","Big","Big","Big"], "Quantity":[2,4,3,5,1,2,6,5,6,4,2,1]}) …

Total answers: 2