|
from selenium import webdriver |
|
from selenium.webdriver.chrome.service import Service |
|
from webdriver_manager.chrome import ChromeDriverManager |
|
from selenium.webdriver.chrome.options import Options |
|
from selenium.webdriver.common.by import By |
|
from selenium.webdriver.support.ui import WebDriverWait |
|
from selenium.webdriver.support import expected_conditions as EC |
|
|
|
|
|
chrome_options = Options() |
|
chrome_options.add_argument("--headless") |
|
chrome_options.add_argument("--no-sandbox") |
|
chrome_options.add_argument("--disable-dev-shm-usage") |
|
|
|
|
|
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options) |
|
|
|
|
|
url = "https://genyoutube.online/url=https://www.youtube.com/watch?v=-2RAq5o5pwc&list=RD-2RAq5o5pwc&start_radio=1" |
|
driver.get(url) |
|
|
|
|
|
print(driver.title) |
|
|
|
|
|
try: |
|
my_tab_content = WebDriverWait(driver, 10).until( |
|
EC.presence_of_element_located((By.ID, "myTabContent")) |
|
) |
|
print(my_tab_content.text) |
|
except Exception as e: |
|
print("Error locating the element:", e) |
|
|
|
|
|
driver.quit() |
|
|