Tutorial: Selenium Automation on Google Colab Notebook

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ • 88

  • @soroush_thr
    @soroush_thr Рік тому +33

    Perfectly explained! Just note that if you are receiving errors with Webdriver.Chrome not having an execuatable_path argument, simply omit this argument and run with the options only ( driver = webdriver.Chrome(options=options) ). New versions of selenium do not support this argument and it is not necessary to be included.

  • @lochanaemandi6405
    @lochanaemandi6405 Рік тому +4

    Thank you so very much. After 9 hours of wasting time on google, I found this video. Keep making more videos bro. Great help

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      You are welcome Lochana i am glad you found this video useful, don’t forget to subscribe

  • @chomchomeizy4098
    @chomchomeizy4098 7 місяців тому

    Thank you so much for this video. I wasted 24 hours in futility trying to find a way to get Selenium to work on Colab; TILL i found your video, and bam! It worked. I had errors with the executable path, so i had to remove it completely and passed only the options argument. ❤

    • @ScrapingNinja
      @ScrapingNinja  7 місяців тому

      You are welcome, 🤗 I am glad you find this video useful, don’t forget to subscribe.

  • @dakshbhatnagar
    @dakshbhatnagar 6 місяців тому +2

    This is still relevant in 2024. Definitely a helpful vid.; Btw what to do if the same is to be done locally? I am on MacOS

    • @ScrapingNinja
      @ScrapingNinja  6 місяців тому

      Thanks man, and I think you can, i will check

  • @nayeemuddinkhan5852
    @nayeemuddinkhan5852 Рік тому

    Great video.I has been 2 days I have been looking for this solution. JajakAllah Khairan.

    • @ScrapingNinja
      @ScrapingNinja  Рік тому +1

      I am glad you find this helpful don’t forget to subscribe..

    • @nayeemuddinkhan5852
      @nayeemuddinkhan5852 Рік тому

      @@ScrapingNinja already did

    • @nayeemuddinkhan5852
      @nayeemuddinkhan5852 Рік тому

      @@ScrapingNinja It would be of great help, if you give tutorials about social media scraping (twitter, facebook, Instagram etc)

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      good idea...

  • @motivationThrive1011
    @motivationThrive1011 2 роки тому +1

    superr bro its working i have searched lot of videos it not working in google colab your code is working bro thanks

    • @ScrapingNinja
      @ScrapingNinja  2 роки тому

      You are welcome 🙏 i am glad you liked the video..

  • @muhammadrafi4766
    @muhammadrafi4766 Рік тому +1

    excuse me, i wanna ask.. why the data is not come out. i mean all code is run executed green.. but the output is wont go out.. ?? any answer please

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      Try to follow step by step, double check the xpath, make sure you are printing the output, also update the xpath to make sure it’s upto date with website.

  • @mohdwasi1769
    @mohdwasi1769 Рік тому +1

    Hi! How should i tackle the problem that says' execuatable_path is not defined'

    • @ScrapingNinja
      @ScrapingNinja  Рік тому +1

      If you are using the colab you dont need to use this and if you aren’t you have typo its supposed to be executable_path

  • @sup5356
    @sup5356 Рік тому

    Thank you so so much. So clear, so concise. Google documentation sucketh. Hard.

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      You are welcome.. :) don't forget to subscribe

  • @matei5054
    @matei5054 Рік тому

    im getting this error: ls: cannot access '/usr/lib/chromium-browser/chromedriver/': Not a directory. There no files like you as in 5:42

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      Where you are getting this error? Which line of code?

    • @matei5054
      @matei5054 Рік тому

      @@ScrapingNinja im executing on google colab

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      You can completely remove the executable path argument

  • @mohitshrivastav2783
    @mohitshrivastav2783 Рік тому +1

    Sir, thanks a lot for making this video. I've one query that can I use google colab in my android phone and then use selenium. Will it work ?

    • @ScrapingNinja
      @ScrapingNinja  Рік тому +1

      Yes it should work fine because even if you are using it on mobile the backend os is same..

  • @churagajyu5100
    @churagajyu5100 9 місяців тому

    This is awesome! Thank you :) Could you make a tutorial how to get job description info from indeed?

    • @ScrapingNinja
      @ScrapingNinja  9 місяців тому

      Thanks.. 🙏 i will try to make one but you can do it yourself by using either selenium or playwright and get the details from any website.

    • @churagajyu5100
      @churagajyu5100 9 місяців тому

      @@ScrapingNinja I tried it but the hard part is to getting the right div id or class. I am not getting any result when I do something like this.
      job_descriptions = driver.find_elements(By.XPATH, '//div[@class="jobsearch-jobDescriptionText"]')

    • @ScrapingNinja
      @ScrapingNinja  9 місяців тому

      Make sure the content is loaded before you search for this. Also in inspect element press ctrl+f and past your xpath “without inverted commas” there and it will show you if your xpath is correct and locats the element

  • @SandeepVarun47
    @SandeepVarun47 Рік тому

    I have followed the steps but it says webdriver__init__() got unexpected keyword argument ‘executable_path’. I even tried using another notebook but same

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      watch ua-cam.com/video/VSO14hgo6Gs/v-deo.html its latest.. new version doesn't need executable_path

  • @verissimobortolin6353
    @verissimobortolin6353 Рік тому

    Thank you very much!!

  • @asimplecompany
    @asimplecompany Рік тому

    Please help, I keep getting this issue: TypeError: WebDriver.__init__() got multiple values for argument 'options'
    I have selenium 4.12.0

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      you are probably passing more than one arguments the options are supposed to be like this.. webdriver.Chrome(options=options)

    • @DuyenLe-vs6xl
      @DuyenLe-vs6xl Рік тому

      @@ScrapingNinja Please help, I got the same error, I wrote exactly like your tutorial. Thank you very much.
      here is the code:
      options = webdriver.ChromeOptions()
      options.add_argument('--no-sandbox')
      options.add_argument('--headless')
      options.add_argument('--disable-gpu')
      options.add_argument('--disable-dev-shm-usage')
      d = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver', options = options)
      error:
      TypeError Traceback (most recent call last)
      in ()
      6 options.add_argument('--disable-dev-shm-usage')
      7
      ----> 8 d = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver', options = options)
      TypeError: WebDriver.__init__() got multiple values for argument 'options'

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      Hi Duyen your d=webdriver part is not correct please check the video or blog again

  • @puteriananditya1935
    @puteriananditya1935 4 місяці тому

    i use this to scrape google maps reviews, but it return in chinese 😵‍💫, also does Google Colab really not display pop ups?

    • @ScrapingNinja
      @ScrapingNinja  4 місяці тому

      Open whatsmyip website in colab and check where your colab ip is located, colab runs on servers and yours probably located in china.

  • @AlexeyZubkov
    @AlexeyZubkov Рік тому +1

    How about headfull!?

    • @ScrapingNinja
      @ScrapingNinja  Рік тому +1

      Colab is linux based environment so headful is not going to work.

  • @ivanguedes4483
    @ivanguedes4483 Рік тому

    excelent. iam brasil. Is possible to have interactions by elements of page, click, write, etc... for selenium colab?

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      Yes all the tasks are possible as we do in selenium..

  • @animeshroy7301
    @animeshroy7301 6 місяців тому

    i am getting this error "'str' object has no attribute 'capabilities'"
    please help

    • @ScrapingNinja
      @ScrapingNinja  6 місяців тому

      Check to make sure you have correctly imported options and its not a string

  • @SaleheJavaheri
    @SaleheJavaheri Рік тому

    nice. thank you so much

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      You are most welcome, don't forget to subscribe

  • @mehdismaeili3743
    @mehdismaeili3743 Рік тому

    Excellent.

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      Thank you! Cheers! don't forget to subscribe

  • @aboutMindseta7607
    @aboutMindseta7607 Рік тому +2

    NameError: name 'webdriver' is not defined

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      You need to import webdriver first
      from selenium import webdriver

    • @kingki1953
      @kingki1953 Рік тому

      nameerror is mostly because you forgot to define something. It's cause by undefined variable or you miss to import library or incorrect recall variable/library

    • @sweela1
      @sweela1 7 місяців тому

      Is ka solution kia hai?

  • @fatimahabib1431
    @fatimahabib1431 Рік тому +1

    Thanks you so much, your tutorial is straightforward. I have a question, now
    -I installed chromium-browser using !apt-get install -y chromium-browser.
    -Then I run !ls/usr/lib/,
    however I could not find chromium-browser in the list of libraries, is it normall, could i find it in other directory ?

    • @ScrapingNinja
      @ScrapingNinja  Рік тому +2

      It could be at another directory try
      !which chromium-browser
      and it will tell you if its installed and where

  • @nicolasfernandez5256
    @nicolasfernandez5256 2 роки тому +1

    Where is the link?

  • @vishvajitviswanathan7970
    @vishvajitviswanathan7970 Рік тому

    Driver.maximize window means, it has to pop a new window but it's not showing

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      its to maximize the current window

    • @vishvajitviswanathan7970
      @vishvajitviswanathan7970 Рік тому

      @@ScrapingNinja but it's not opening the window, a new window has to appear, Like a new chrome page

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      to open you need to
      driver = webdriver.Chrome()

  • @boletgros
    @boletgros Рік тому +1

    dont work no more it says version is outdated

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      you need to install again.. follow steps in new notebook

  • @AzharAli-cr2vj
    @AzharAli-cr2vj Рік тому

    Executable_path error is showing

    • @ScrapingNinja
      @ScrapingNinja  Рік тому

      Follow the code step by step if you still get the error create new colab notebook and follow the steps again.

  • @juanwoodcock5217
    @juanwoodcock5217 9 місяців тому

    Thanks a lot. +1 like +1 subs