Remove previous code from media_files_extractor.py
				
					
				
			This commit is contained in:
		@@ -1,7 +1,6 @@
 | 
			
		||||
from selenium import webdriver
 | 
			
		||||
from selenium.webdriver.common.by import By
 | 
			
		||||
from selenium.webdriver.firefox.options import Options
 | 
			
		||||
#from selenium.webdriver.common.action_chains import ActionChains
 | 
			
		||||
import json
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
@@ -22,21 +21,13 @@ So I assume YouTube UI pagination doesn't work fine, so to retrieve all media fi
 | 
			
		||||
We could verify the `trackId` or `viperId` to avoid downloading other media files containing the provided title.
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
#actions = ActionChains(browser)
 | 
			
		||||
 | 
			
		||||
with open('music.json') as json_file:
 | 
			
		||||
    tracks = json.load(json_file)
 | 
			
		||||
 | 
			
		||||
for track in tracks:
 | 
			
		||||
    #browser.find_element(By.ID, 'text-input').click()
 | 
			
		||||
    #browser.find_element(By.ID, 'text-item-2').click()
 | 
			
		||||
    #actions.send_keys(track['title'])
 | 
			
		||||
    #ctions.perform()
 | 
			
		||||
    browser.find_element(By.ID, 'text-input').send_keys(track['title'])
 | 
			
		||||
    browser.find_element(By.XPATH, '/html/body/ytcp-text-menu/tp-yt-paper-dialog/tp-yt-paper-listbox/tp-yt-paper-item[2]/ytcp-ve/div/div/yt-formatted-string/span[1]').click()
 | 
			
		||||
 | 
			
		||||
    #browser.find_element(By.XPATH, '/html/body/ytcp-filter-dialog/tp-yt-paper-dialog/div[2]/ytcp-button/div').click()
 | 
			
		||||
 | 
			
		||||
    number_of_results = int(browser.find_element(By.CSS_SELECTOR, '.page-description').get_attribute('innerHTML').split()[-1])
 | 
			
		||||
    print(number_of_results)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user