Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Selenium (Dropdown-) data
#1
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
Reply
#2
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()
Reply
#3
thanks for sharing and desire you a satisfied life
google seo
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Generating dynamic dropdown list test 1 1,428 Aug-30-2023, 08:00 AM
Last Post: blessinguvula
  Selenium Python for Dropdown not working gj31980 1 2,612 Oct-27-2020, 02:02 AM
Last Post: gj31980
  Extract data with Selenium and BeautifulSoup nestor 3 3,822 Jun-06-2020, 01:34 AM
Last Post: Larz60+
  Dropdown interact moisesfelipee 0 1,659 May-04-2020, 01:11 AM
Last Post: moisesfelipee
  Clicking on element not triggering event in Selenium Python (Event Key is not in data dkaeloredo 2 4,236 Feb-16-2020, 05:50 AM
Last Post: dkaeloredo
  While loop skips multiple dropdown menu options and then works as intended newbie_programmer 1 2,842 Dec-23-2019, 10:26 PM
Last Post: keuninkske
  How can i scrape dropdown value ? caca 0 2,945 Nov-03-2019, 11:24 PM
Last Post: caca
  Selenium get data from newly accessed page hoff1022 2 2,904 Oct-09-2019, 06:52 PM
Last Post: hoff1022
  How to Caputre Data After Selenium Scroll ahmedwaqas92 3 6,963 Aug-18-2019, 12:43 PM
Last Post: ahmedwaqas92
  Unable to access javaScript generated data with selenium and headless FireFox. pjn4 0 2,502 Aug-04-2019, 11:10 AM
Last Post: pjn4

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020