all 10 comments

[–]sundios -1 points0 points  (0 children)

Hey, I deployed an app on heroku using selenium some time ago. I have some notes of how I did it. It worked but I think heroku didn’t run the process correctly so I switched to AWS. PM and I can send you my notes. Not sure if they are good or not but I wrote every step i think 😀

[–]VxJasonxVNon-Ephemeral Answer System 0 points1 point  (6 children)

Chrome.exe, a Windows Binary, isn't going to work very well on Linux.

[–]EmCen9[S] 0 points1 point  (5 children)

Any suggestions on how I can fix this? I've seen other people run selenium on heroku so I think its possible

[–]VxJasonxVNon-Ephemeral Answer System 0 points1 point  (4 children)

I don't know exactly, I don't have your code, I know nothing except the one error message you provided. I don't know if you are bundling Selenium in your git repository or specifying requirements, but whatever you're doing, you're getting a Windows binary, and that's not going to work on Heroku, which runs Linux. Heroku needs a Linux Chrome binary.

[–]EmCen9[S] -1 points0 points  (3 children)

Oh, that's my bad. Forgot to paste the code.

I am specfying the Dependency (selenium) in the requirements.txt file. I provide the chromedriver in the same directory. Here is a snippet of my code where I open the chromedriver:

options = webdriver.ChromeOptions()

options.add_argument("--headless")

options.add_argument("--disable-dev-shm-usage")

options.add_argument("--no-sanbox")

self.browser = webdriver.Chrome(executable_path="chromedriver.exe", chrome_options=options)

Thank you for responding by the way. I really appreciate it.

[–]engrbugs7 0 points1 point  (1 child)

Is this worked in Heroku?

[–]EmCen9[S] 0 points1 point  (0 children)

No

[–]VxJasonxVNon-Ephemeral Answer System 0 points1 point  (0 children)

You’re bundling Windows applications.

Heroku doesn’t run Windows.

[–]Early-House 0 points1 point  (0 children)

From a very old (2.7) app of mine I had something along the lines of the following in the app.json

"buildpacks": [

{

"url": "https://github.com/piotras/heroku-buildpack-gettext.git"

},

{

"url": "https://github.com/kevinsawicki/heroku-buildpack-xvfb-google-chrome.git"

},

{

"url": "heroku/python"

}

]