Reputation: 355
I am trying to run selenium based scraping service on ubuntu but chrome driver does not load page. It is stuck on loading, however when I open new tab manually, it loads the website? I cannot figure out the exact issue because it does not throw any error. Following is the output I get,
Following is the code I am running.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
ch_ser=Service(executable_path='/usr/bin/chromedriver')
chrome_options = Options()
chrome_options.add_argument('--no-sandbox')
##chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-extensions')
driver = webdriver.Chrome(service=ch_ser,options=chrome_options)
#print("Opening page."
driver.get('https://google.com')
Upvotes: 1
Views: 786
Reputation: 145
I had the same problem on my Raspberry pi 4 with XFCE (xubuntu 64bit) linux. The problem is probably in Chromedriver.
I solved this problem by replacing Chromium with Firefox.
If you are on Linux too, try to install geckodriver for Firefox and use it instead of Chrome.
sudo apt install firefox-geckodriver
Upvotes: 1