skip to Main Content

I am using Github codespace for creating an automated web scraping application using Webdriver-manager webdriver-manager with Selenium.

I have tried: How can we use Selenium Webdriver in collab.research.google.com?

!pip install selenium
!apt-get update # to update ubuntu to correctly run apt install
!apt install chromium-chromedriver
!cp /usr/lib/chromium-browser/chromedriver /usr/bin
import sys
sys.path.insert(0,'/usr/lib/chromium-browser/chromedriver')
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
wd = webdriver.Chrome('chromedriver',options=chrome_options)
wd.get("https://www.webite-url.com")

But it did not work!
Can you help me in setting up Webdriver-manager github codespaces or share some link?

2

Answers


  1. Please consider rephrasing the question in a better way. The problematic is not clear.

    Login or Signup to reply.
  2. please check https://stackoverflow.com/posts/46929945

    this should work for you,

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    options = Options()
    options.headless = True
    driver = webdriver.Chrome(CHROMEDRIVER_PATH, options=options)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search