sahanind commited on
Commit
ef788d8
1 Parent(s): 10e999f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -12
app.py CHANGED
@@ -1,19 +1,14 @@
1
  from selenium import webdriver
2
- from selenium.webdriver.chrome.service import Service
3
- from webdriver_manager.chrome import ChromeDriverManager
4
- from selenium.webdriver.chrome.options import Options
5
- from selenium.webdriver.common.by import By
6
- from selenium.webdriver.support.ui import WebDriverWait
7
- from selenium.webdriver.support import expected_conditions as EC
8
 
9
- # Set Chrome to run in headless mode to save memory
10
- chrome_options = Options()
11
- chrome_options.add_argument("--headless") # Headless mode
12
- chrome_options.add_argument("--no-sandbox") # Necessary for running in some environments
13
- chrome_options.add_argument("--disable-dev-shm-usage") # Overcome limited resource problems
14
 
15
  # Initialize the Chrome WebDriver
16
- driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
17
 
18
  # Go to the provided URL
19
  url = "https://genyoutube.online/url=https://www.youtube.com/watch?v=-2RAq5o5pwc&list=RD-2RAq5o5pwc&start_radio=1"
 
1
  from selenium import webdriver
2
+ from selenium.common.exceptions import WebDriverException
3
+
4
+ options = webdriver.ChromeOptions()
5
+ options.add_argument('--headless')
6
+ options.add_argument('--no-sandbox')
7
+ options.add_argument('--disable-dev-shm-usage')
8
 
 
 
 
 
 
9
 
10
  # Initialize the Chrome WebDriver
11
+ driver = webdriver.Chrome(options=options)
12
 
13
  # Go to the provided URL
14
  url = "https://genyoutube.online/url=https://www.youtube.com/watch?v=-2RAq5o5pwc&list=RD-2RAq5o5pwc&start_radio=1"