Python Forum

Full Version: Python Selenium (Dropdown-) data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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()
thanks for sharing and desire you a satisfied life
google seo