Switch back to Chrome webdriver, user should run with xvfb-run for headless support
This commit is contained in:
1 parent
8b68b382ff
commit
b50b430a5f
1 file changed
+8
-5
@@ -9,9 +9,9 @@ creates a playlist of matching songs, and imports it into Plex.
|
||||
|
||||
import time
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.firefox.service import Service
|
||||
from webdriver_manager.firefox import GeckoDriverManager
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
from webdriver_manager.chrome import ChromeDriverManager
|
||||
from selenium.webdriver.common.by import By
|
||||
from bs4 import BeautifulSoup
|
||||
import os
|
||||
@@ -45,9 +45,12 @@ def scrape_recently_played():
|
||||
for url, source in urls:
|
||||
options = Options()
|
||||
options.add_argument("--headless")
|
||||
options.add_argument("--no-sandbox")
|
||||
options.add_argument("--disable-dev-shm-usage")
|
||||
options.add_argument("--disable-gpu")
|
||||
|
||||
service = Service(GeckoDriverManager().install())
|
||||
driver = webdriver.Firefox(service=service, options=options)
|
||||
service = Service(ChromeDriverManager().install())
|
||||
driver = webdriver.Chrome(service=service, options=options)
|
||||
|
||||
driver.get(url)
|
||||
|
||||
|
||||
Reference in new issue
Block a user