Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
import time
from selenium import webdriver
from selenium.webdriver import ActionChains
driver = webdriver.Chrome()
driver.get('https://salsabeatmachine.org/')
move = ActionChains(driver)
# Ползунок BPM
thumb = driver.find_element_by_class_name('mat-slider-thumb')
# Открываем ползунок громкости пиано
driver.find_element_by_xpath('/html/body/bm-root/div[2]/mat-card[2]/div[4]/bm-instrument-tile/div/div[2]/button[2]/span/mat-icon').click()
# Сам ползунок громкости
piano_thumb = driver.find_element_by_xpath('/html/body/bm-root/div[2]/mat-card[2]/div[4]/bm-instrument-tile/mat-slider/div/div[3]/div[2]')
# Пускаем музыку
driver.find_element_by_class_name('mat-button').click()
time.sleep(2)
# Выключаем пианино и делаем такт быстрее
move.click_and_hold(thumb).move_by_offset(10, 0).release().perform()
move.click_and_hold(piano_thumb).move_by_offset(-200, 0).release().perform()
time.sleep(4)
# Ещё чуть быстрее
move.click_and_hold(thumb).move_by_offset(20, 0).release().perform()
time.sleep(4)
driver.quit()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question