![]() |
Python Selenium (Dropdown-) data - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html) +--- Thread: Python Selenium (Dropdown-) data (/thread-8699.html) |
Python Selenium (Dropdown-) data - Robin_at_Cantelli - Mar-04-2018 Hi, I want to change the currency (left upper corner) on the website https://www.bitstamp.net/. For example from BTC/USD to BTC/EUR to extract specific data for statistical uses. It is kind of a drop down list, but not really. I have the same problem at https://www.kraken.com/charts. (Also left upper corner) Even it is quite similar to the first problem its different. I would like to do change the values in both websites so that I can compare the same currencies at the different web pages. I really hope, that you can help me! Thanks and best regards Robin RE: Python Selenium (Dropdown-) data - snippsat - Mar-04-2018 First click to get dropdown active. Then ActionChains to perform mouse over action.When mouse over choice is done,then click on choice. Example: from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains import time browser = webdriver.Chrome() browser.get('https://www.kraken.com/charts') time.sleep(3) b = browser.find_element_by_css_selector('#pairselect-button') b.click() time.sleep(1) #--- gno = browser.find_element_by_xpath('//*[@id="topside"]/div[2]/div/div/div/div[1]/ul/li[10]/a') hover = ActionChains(browser).move_to_element(gno) hover.perform() time.sleep(1) #--- gno_eur = browser.find_element_by_xpath('//*[@id="topside"]/div[2]/div/div/div/div[1]/ul/li[10]/ul/li[2]/a') hover = ActionChains(browser).move_to_element(gno_eur) hover.perform() time.sleep(1) #--- # After choice drop-down click on element gno_click = browser.find_element_by_xpath('//*[@id="topside"]/div[2]/div/div/div/div[1]/ul/li[10]/ul/li[2]/a') gno_click.click() RE: Python Selenium (Dropdown-) data - ondreweil - Dec-29-2021 thanks for sharing and desire you a satisfied life google seo |