R
Railway

✋|help

Path of a Nixpacks (google-chrome, chromedriver) [Python]

Aazuxorce11/25/2022
Hello, with the latest update I could install google-chrome and chromedriver using Nixpacks by adding a railway.json file like this (in case other people are interested):
{
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["...", "python"],
"phases": {
"setup": {
"nixPkgs": ["...", "google-chrome", "chromedriver"]
}
}
}
}
}
{
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["...", "python"],
"phases": {
"setup": {
"nixPkgs": ["...", "google-chrome", "chromedriver"]
}
}
}
}
}
Now in order to use Selenium to webscrape (with permission), I would need to point it to the google-chrome and chromedriver path, but where is it located? How do I get access to it? (In my directories there's just a .nix file btw) Specifically, what should I write instead of '[full-google-chrome-path]' and '[full-chromedriver-path]' in the following situation:
from selenium import webdriver
GOOGLE_CHROME_PATH = '[full-google-chrome-path]'
CHROMEDRIVER_PATH = '[full-chromedriver-path]'
op = webdriver.ChromeOptions()
op.binary_location = GOOGLE_CHROME_PATH
op.add_argument('--headless')
op.add_argument('--disable-gpu')
op.add_argument('--no-sandbox')
op.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, chrome_options=op)
from selenium import webdriver
GOOGLE_CHROME_PATH = '[full-google-chrome-path]'
CHROMEDRIVER_PATH = '[full-chromedriver-path]'
op = webdriver.ChromeOptions()
op.binary_location = GOOGLE_CHROME_PATH
op.add_argument('--headless')
op.add_argument('--disable-gpu')
op.add_argument('--no-sandbox')
op.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(executable_path=CHROMEDRIVER_PATH, chrome_options=op)
Thanks!
PPercy11/25/2022
Project ID: N/A
Aazuxorce12/2/2022
N/A This is probably a newbie question, but that's what I am in Nixpacks... maybe someone can give me a clue on this? It's probably just a one-sentence answer. Thanks! Or do I have to install google-chrome after that? How would I do that actually? Help is very appreciated! If this is too trivial that everyone is facepalming me and moving on, please at least react so that I know this is trivial and I'm simply dumb... 😦
Jjr12/2/2022
Hi @AzuXorce(at)シノン教, Sorry for such a delayed response on this. I haven't used google-chrome or chromedriver on nix before, but the paths of the binaries can be found in /root/.nix-profile/bin
Jjr12/2/2022
Jjr12/2/2022
You might also want the dev or beta versions of chrome

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
failing to buildmy builds are failingI'm having issues with my deploymentI am trying to redeploy a project. Here is the response I am getting. ```bash #3 [internal] load meScheduling Jobs to run far in the futureHey there, I have a Typescript project running on Railway. I am looking to dynamically schedule a Dockerfile working on local machine but not RailwayHere is my dockerfile ```dockerfile FROM rust:latest ARG DATABASE_URL WORKDIR /usr/src/pail COPY Prisma and nextjs app with pg urlFrom your example, it deploys both: a postgres container and a nodejs container, but to be able to project idhow do you find the project idSetting up a local environmentFor a variety of reasons I typically like to develop completely locally. I'm using the Next.js / PriQuestions about automatic deployment with a new PR.Hi, I'm waiting for my PR to be deployed automatically on Railway. The PRs were deployed on the firsDocker DATABASE_URLI have a PostgreSQL database and an application built user docker. How would I use the connection urExpress server to subdomainHi I have a backend code that uses express.js and I would like to deploy this app to my subdomain toQuestions about pricingHi, I’m a new Railway user that primarily uses it for Discord bots. I was wondering, do the free plGoogle oauth redirect -- nginx 404I've implemented google oauth, but redirects are broken due to the way the proxy is setup on RailwayDo I need SSL Certificates?My app is up and running with Django. When I attempt to enable the secure SSL redirect setting in DjBandwidth limitsI don't understand how much bandwidth I have on a developer plan and how it is priced. I am currentlRuby app crashing because of missing (bundle ran)Recently we added some google API gems to our Ruby app and we have seen front-end and back-end serviDeploy failed and it's weirdHi, for some reason I am getting this when deploying: ``` #13 1.852 django.db.utils.OperationalErroread ECONNRESET on my databaseConnections and queries to my database suddenly stoped working, and I have no idea why.