Spaces:
Runtime error
Runtime error
Update scraping.py
Browse files- scraping.py +20 -13
scraping.py
CHANGED
|
@@ -16,21 +16,28 @@ def get_mp3(song_title):
|
|
| 16 |
# os.makedirs(download_directory, exist_ok=True)
|
| 17 |
|
| 18 |
# Set up Chrome options
|
| 19 |
-
options = Options()
|
| 20 |
-
options.add_argument("--headless")
|
| 21 |
-
options.add_argument("--no-sandbox") # Bypass OS security model, necessary on certain platforms
|
| 22 |
-
options.add_argument("--disable-dev-shm-usage") # Overcome limited resource problems
|
| 23 |
-
#options.add_argument(f"download.default_directory={download_dir}") # Set download directory
|
| 24 |
-
options.add_experimental_option("prefs", {
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
# Set up the Selenium WebDriver (e.g., Chrome)
|
| 33 |
-
driver = webdriver.Chrome(chrome_options=options)
|
| 34 |
|
| 35 |
# Navigate to the website
|
| 36 |
driver.get("https://suno.com/me")
|
|
|
|
| 16 |
# os.makedirs(download_directory, exist_ok=True)
|
| 17 |
|
| 18 |
# Set up Chrome options
|
| 19 |
+
# options = Options()
|
| 20 |
+
# options.add_argument("--headless")
|
| 21 |
+
# options.add_argument("--no-sandbox") # Bypass OS security model, necessary on certain platforms
|
| 22 |
+
# options.add_argument("--disable-dev-shm-usage") # Overcome limited resource problems
|
| 23 |
+
# #options.add_argument(f"download.default_directory={download_dir}") # Set download directory
|
| 24 |
+
# options.add_experimental_option("prefs", {
|
| 25 |
+
# # "download.default_directory": download_dir,
|
| 26 |
+
# # "download.prompt_for_download": False,
|
| 27 |
+
# # "download.directory_upgrade": True,
|
| 28 |
+
# "plugins.always_open_pdf_externally": True, # Auto-download PDFs
|
| 29 |
+
# "safebrowsing.enabled": True # Enable safe browsing to avoid triggering the browser's security warnings
|
| 30 |
+
# })
|
| 31 |
+
|
| 32 |
+
chrome_options = webdriver.ChromeOptions()
|
| 33 |
+
chrome_options.add_argument('--headless')
|
| 34 |
+
chrome_options.add_argument('--no-sandbox')
|
| 35 |
+
chrome_options.add_argument('--disable-dev-shm-usage')
|
| 36 |
+
driver = webdriver.Chrome('chromedriver',chrome_options=chrome_options)
|
| 37 |
+
|
| 38 |
|
| 39 |
# Set up the Selenium WebDriver (e.g., Chrome)
|
| 40 |
+
#driver = webdriver.Chrome(chrome_options=options)
|
| 41 |
|
| 42 |
# Navigate to the website
|
| 43 |
driver.get("https://suno.com/me")
|