-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrahamTestFile.py
More file actions
49 lines (37 loc) · 1.46 KB
/
GrahamTestFile.py
File metadata and controls
49 lines (37 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import requests
import random
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium.webdriver.chrome.options import Options
def SoManyNights():
SoManyNights = driver.get("https://soundcloud.com/eddison-duolo-546732382/so-many-nights-ed-tank")
low_play_btn = driver.find_element_by_xpath('//*[@id="app"]/div[4]/section/div/div[3]/button[2]')
low_play_btn.click()
time.sleep(10)
low_pause_btn = driver.find_element_by_xpath('//*[@id="app"]/div[4]/section/div/div[3]/button[2]')
low_pause_btn.click()
time.sleep(1)
def NewTab(url):
driver.execute_script("window.open('');")
driver.switch_to.window(driver.window_handles[1])
driver.get(url)
time.sleep(3)
def PlayandStop():
high_play_btn = driver.find_element_by_xpath('//*[@id="content"]/div/div[2]/div/div[2]/div[2]/div/div/div[1]/a')
high_play_btn.click()
time.sleep(10)
low_pause_btn = driver.find_element_by_xpath('//*[@id="app"]/div[4]/section/div/div[3]/button[2]')
low_pause_btn.click()
time.sleep(1)
def CloseAllWindows():
driver.quit()
for x in range (1,3):
driver = webdriver.Chrome("/Users/grahamlenert/Downloads/chromedriverowen")
SoManyNights()
NewTab('https://soundcloud.com/eddison-duolo-546732382/lil-pacco-ft-zay2x-fullclip')
PlayandStop()
NewTab('https://soundcloud.com/eddison-duolo-546732382/lil-pacco-ft-jayv2')
PlayandStop()
CloseAllWindows()
time.sleep(2)