Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,14 @@
|
|
1 |
from selenium import webdriver
|
2 |
-
from selenium.
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
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(
|
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"
|