How to install headless chrome browser on Mac
Step#1: install google chrome using below command
brew install Caskroom/versions/google-chrome-canary
Once installed, find the path of the app using below command
sudo find / -type d -name "*Chrome Canary.app"
While the code gets executed, you will come across some permissions issues and dialogue popup to seek permission to check certain directories ( click cancel on all the dialogue pop ups, just to be safe side by not allowing terminal to interact with any apps)
However, you will see the path like this for the r we installed just now
/Applications/Google Chrome Canary.app
Once we find the path, we can start the headless browser using the below command:
Change the website you want to navigate to:
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --headless --remote-debugging-port=9222 --disable-gpu https://finance.yahoo.com
Comments
Post a Comment