Skip to content

Commit

Permalink
fix: ajustar las rutas de chromedriver
Browse files Browse the repository at this point in the history
  • Loading branch information
rociobenitez committed Jan 6, 2025
1 parent 61a69ff commit 14fe538
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/fotocasa-scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit 14fe538

Please sign in to comment.