Skip to content

Instantly share code, notes, and snippets.

@samirsaci
Created March 13, 2021 17:57
Show Gist options
  • Save samirsaci/3631ff8b4b44d46daf67f6354b126c6e to your computer and use it in GitHub Desktop.
Save samirsaci/3631ff8b4b44d46daf67f6354b126c6e to your computer and use it in GitHub Desktop.
Initialize Selenium Bot
import os
from selenium import webdriver
from bs4 import BeautifulSoup as soup
# Chromedrive setting
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_options.binary_location = os.environ.get("GOOGLE_CHROME_BIN")
driver = webdriver.Chrome(executable_path=os.environ.get("CHROMEDRIVER_PATH"), chrome_options=chrome_options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment