diff --git a/.github/workflows/fotocasa-scraper.yml b/.github/workflows/fotocasa-scraper.yml index 02dd739..e4f839b 100644 --- a/.github/workflows/fotocasa-scraper.yml +++ b/.github/workflows/fotocasa-scraper.yml @@ -45,6 +45,7 @@ jobs: wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install -y ./google-chrome-stable_current_amd64.deb sudo apt-get install -y chromium-chromedriver + ln -s /snap/bin/chromium /usr/bin/google-chrome ln -s /usr/bin/chromedriver /usr/local/bin/chromedriver echo "Google Chrome version:" google-chrome --version diff --git a/main.py b/main.py index ac0bbbf..b3b9835 100644 --- a/main.py +++ b/main.py @@ -7,16 +7,16 @@ from bs4 import BeautifulSoup # Configurar el servicio de Chromedriver -chrome_service = Service(executable_path="/usr/bin/chromedriver") +chrome_service = Service(executable_path="/usr/local/bin/chromedriver") # Configurar opciones de Chrome chrome_options = webdriver.ChromeOptions() chrome_options.add_experimental_option("detach", True) -chrome_options.binary_location = "/snap/bin/chromium" -chrome_options.add_argument("--headless") # Ejecutar en modo sin interfaz -chrome_options.add_argument("--no-sandbox") # Solución para problemas de entorno -chrome_options.add_argument("--disable-dev-shm-usage") # Solución para problemas de memoria compartida +chrome_options.add_argument("--headless") # Ejecutar en modo sin interfaz +chrome_options.add_argument("--no-sandbox") # Solución para problemas de entorno +chrome_options.add_argument("--disable-dev-shm-usage") # Solución para problemas de memoria compartida chrome_options.add_argument("--remote-debugging-port=9222") +chrome_options.binary_location = "/usr/bin/google-chrome" # Enlace forzado al binario correcto chrome_options.add_argument( "user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.86 Safari/537.36" )