from selenium import webdriver
import os
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
driver = WhatsAPIDriver(client='chrome', chrome_options=chrome_options,username="wholesomegarden")
And changed '_init.py'
if chrome_options is not None:
self._profile = chrome_options
## for option in chrome_options:
## self._profile.add_argument(option)
self.logger.info("Starting webdriver")
self.driver = webdriver.Chrome(executable_path=os.environ.get("CHROMEDRIVER_PATH"),chrome_options=self._profile, **extra_params)
And this works :D
the last thing was to also setup a flask server to display the qr :)
and bam! serverless whatsapp api :star:
you can check it all out at in app.py WhatsappReminder
and please let me know if I can do any of this better :+1:
THANK YOU AND HAPPY NEW YEAR 2021 :love_you_gesture:
Hi there, first of all thank you so much for this repo. Really amazing :)
i've read that it's better to user gecko firefox instead of chrome because of async problems.
Q1: is this a problem with the driver or with this repo? will an update to the driver in the future change this?
Q2: Can someone please make a tutorial on how to run this well on Heroku ?!
I've been running this quite well from docker and also from source Wanna move this to Heroku for 24/7 uptime :D
For the life of me I couldnt get my head around how to do these in heroku (a guide will be great!)
I've tried adding various buildpacks for firefox and gecko and pushing mirror of source to heroku but couldnt do it either
Finally I've been able to follow... Running ChromeDriver with Python Selenium on Heroku (adding buildpacks and env variables)
Then changed updated my code to include...
And changed '_init.py'
And this works :D
the last thing was to also setup a flask server to display the qr :) and bam! serverless whatsapp api :star: you can check it all out at in app.py WhatsappReminder and please let me know if I can do any of this better :+1: THANK YOU AND HAPPY NEW YEAR 2021 :love_you_gesture: