Python Selenium Tutorial #1 - Web Scraping, Bots & Testing

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

ความคิดเห็น • 1.2K

  • @jashjcomptutorials2723
    @jashjcomptutorials2723 4 ปีที่แล้ว +630

    You, my friend, will go down in history as a legend

    • @priyanshusaraf9495
      @priyanshusaraf9495 4 ปีที่แล้ว +4

      He has already...

    • @mayurkalsekar524
      @mayurkalsekar524 4 ปีที่แล้ว +9

      What if he defeats death and never goes down

    • @ahmadhadwan
      @ahmadhadwan 4 ปีที่แล้ว +22

      @@mayurkalsekar524 creates a script to cheat death XD

    • @mohammedsaad3801
      @mohammedsaad3801 4 ปีที่แล้ว +2

      Haha so true

    • @AbhijeetSinghs
      @AbhijeetSinghs 3 ปีที่แล้ว +2

      That’s way too big words for just a TH-cam video

  • @rohansylvain1702
    @rohansylvain1702 4 ปีที่แล้ว +105

    I was just getting into web scraping, then you dropped this tutorial! Perfect timing.

  • @kosamati9661
    @kosamati9661 4 ปีที่แล้ว +160

    Sunday after lunch (in Poland) I was just about to sit down to study and here's a new tutorial. Perfect timing

    • @wojciechsuchecki5690
      @wojciechsuchecki5690 4 ปีที่แล้ว +5

      Widzę w wybornych tematach się obracasz

    • @twobyfour2468
      @twobyfour2468 4 ปีที่แล้ว +2

      @@wojciechsuchecki5690 A jak

    • @trol9880
      @trol9880 4 ปีที่แล้ว +5

      witam rodaków

    • @weteach3263
      @weteach3263 4 ปีที่แล้ว

      No cześć wszystkim :D

    • @aadichauhan947
      @aadichauhan947 4 ปีที่แล้ว

      @@twobyfour2468 aij ies dàk rozejskï

  • @snavellet5612
    @snavellet5612 4 ปีที่แล้ว +39

    My God, thank you for making a series in selenium

  • @chrisvaia9469
    @chrisvaia9469 3 ปีที่แล้ว +53

    I've never watched a so clear tutorial. Fantastic tutorial!

  • @kiranjoshi6721
    @kiranjoshi6721 4 ปีที่แล้ว +86

    I've used Selenium for automating multiple routine tasks at my work. It is saving lots of time for me.
    Thanks for this series Tim, it'll be good brush up for me.

    • @MrQuay03
      @MrQuay03 3 ปีที่แล้ว +5

      And what are those tasks?

    • @usr829
      @usr829 3 ปีที่แล้ว +1

      Hi kiran, i tried this but not work. Please help me.

    • @pro-socialsociopath769
      @pro-socialsociopath769 ปีที่แล้ว

      ​@@MrQuay03 His safety training ;)

  • @jamesgalantino2901
    @jamesgalantino2901 3 ปีที่แล้ว +64

    Clear, concise. Great stuff, thanks so much. It's dev's like you on TH-cam and more that [literally] make the world go 'round. Appreciate this series!

  • @sapemi08
    @sapemi08 2 หลายเดือนก่อน

    I am an old guy, but I enjoy learning with your videos. As the time passes by I see you growing from an intelligent, agile teen to a more seasoned young man. Cheers!

  • @abdohm809
    @abdohm809 ปีที่แล้ว +93

    If the selenium version you are using is v4.6.0 or above (which I think it is as I see SeleniumManger in the error trace), then you don't really have to set the driver.exe path. Selenium can handle the browser and drivers by itself.
    So your code can be simplified as below:
    from selenium import webdriver
    driver = webdriver.Chrome()

    • @tony6709
      @tony6709 ปีที่แล้ว +2

      Thank you so much! I was struggling with the error until I saw your comment!

    • @fitrianilamsari4050
      @fitrianilamsari4050 ปีที่แล้ว

      thank u, i was struggling til i saw ur comment!

    • @TheScuds
      @TheScuds ปีที่แล้ว

      Will this work with Firefox as well?

    • @wahidurrahman7506
      @wahidurrahman7506 ปีที่แล้ว +1

      I was literally about to make that same comment here after struggling for an hour

    • @husseinsfitness5434
      @husseinsfitness5434 ปีที่แล้ว +1

      legend, thanks

  • @datagonia
    @datagonia ปีที่แล้ว +81

    Hey Tim, might be a good idea to update this video, Selenium now uses Service objects to run the Drivers.

    • @NewCyZ
      @NewCyZ ปีที่แล้ว +2

      Ty

    • @JTJaniceTek
      @JTJaniceTek ปีที่แล้ว

      how can i download the chrome driver now??@@NewCyZ

  • @santhoshxd
    @santhoshxd 4 ปีที่แล้ว +20

    Bro you are great, I thought of making a selenium project today and you started a new series on it. Love you a lot !!

  • @joshiashish1989
    @joshiashish1989 4 ปีที่แล้ว +2

    Spent two hours on Friday evening to find solution to initial setup. I can have a cold beer now. Thanks. You rock!

  • @ryanle6442
    @ryanle6442 4 ปีที่แล้ว +16

    This is a very detailed tutorial on intro to web scraping using Python, well done Tim!

  • @muhammadarsalan7996
    @muhammadarsalan7996 4 ปีที่แล้ว +10

    I was a chemical engineer an year back .... Now I am approaching an MS in CS ...thanks dude ....learnt a lot from you

    • @joshuam2341
      @joshuam2341 4 ปีที่แล้ว

      Good luck!

    • @PaperFc
      @PaperFc 2 ปีที่แล้ว

      Just curious, but why did you make a switch to CS from chem engineering?

  • @sameehanif9192
    @sameehanif9192 4 ปีที่แล้ว +5

    Yesterday I was searching for selenium tutorials for so long and today he posts this video

  • @soviet_onion_4208
    @soviet_onion_4208 4 ปีที่แล้ว +13

    awesone tim that was a great tutorial, i like how u ran through everything that couldve went wrong and showed people how to fix it

  • @geek-ko
    @geek-ko 4 ปีที่แล้ว +14

    Time ago i was starting to understand Slenium! and now we have your selenium tutorial!! YEEES!

  • @mitchdask
    @mitchdask 3 ปีที่แล้ว +2

    What i was trying to setup for 2+ hours with that chromedriver,solved in 5 min effort ,with this video (rookie over here!)That made my day!!!

  • @alfredxavier6568
    @alfredxavier6568 4 ปีที่แล้ว +5

    This would be a great series your fans would watch it.

  • @ristoshikongo7730
    @ristoshikongo7730 2 ปีที่แล้ว +1

    My man. A million subscribers. It's been a long time coming. Keep up the great work.

  • @jawadmansoor6064
    @jawadmansoor6064 3 ปีที่แล้ว +4

    I think you are the best teacher for python. I learned a lot from your beginner's python course (4hours) and now I hope to learn more from this course. Thank you.

  • @0Sareena0
    @0Sareena0 3 หลายเดือนก่อน

    Better than a Udemy course. What a king you are

  • @mdemr7391
    @mdemr7391 3 ปีที่แล้ว +40

    If your tab closes automatically after you run the code and you are using VS Code, Try to run the code right-clicking anywhere in the editor and select Run Python File in Terminal. I was running the code pressing F5, I tried this and it worked

    • @mkianzolz998
      @mkianzolz998 2 ปีที่แล้ว

      thank u

    • @joewidger7954
      @joewidger7954 2 ปีที่แล้ว

      Thank you :)

    • @mehmetemin7932
      @mehmetemin7932 2 ปีที่แล้ว

      thank you

    • @HallofWisdom
      @HallofWisdom 2 ปีที่แล้ว

      --- Thank you, M de mr - I was having that very problem and now it's solved ! --- 20NOV22

    • @alex17k18
      @alex17k18 ปีที่แล้ว +3

      same here, but tab keeps quitting...

  • @danielchoy7030
    @danielchoy7030 3 ปีที่แล้ว +1

    Bruh your channel is omnipresent.

  • @aiamcharina
    @aiamcharina 3 ปีที่แล้ว +13

    Started learning selenium python today and this is really helpful, simple and easy to learn. Thanks a lot!

    • @marius35mm
      @marius35mm 2 ปีที่แล้ว

      Did you knew python before? Asking for a friend...

    • @aiamcharina
      @aiamcharina 2 ปีที่แล้ว

      @@marius35mm Yes, a little bit. Just the basics.

  • @henrygutetama3173
    @henrygutetama3173 4 ปีที่แล้ว +10

    FYI: For the Chrome driver on Windows, you can use chromedriver-binary library "pip install chromedriver-binary" in case you have trouble with the dowloaded driver.

    • @jaredgarbo3679
      @jaredgarbo3679 3 ปีที่แล้ว +1

      @T Bone Have you fixed the issue?

    • @motlatsimoea
      @motlatsimoea 2 ปีที่แล้ว

      @@jaredgarbo3679 I'm also having this same issue incase you managed to fix it..

  • @ZbigniewLoboda
    @ZbigniewLoboda หลายเดือนก่อน


    I love it. Unlike other tutorial authors, this one was well-prepared for the presentation.

  • @SkyFly19853
    @SkyFly19853 4 ปีที่แล้ว +5

    Oh... wow...
    Never thought I would see Selenium on this channel...
    Wow...

  • @tt4kcoding844
    @tt4kcoding844 3 ปีที่แล้ว +1

    the best python teacher in the world 💓💓

  • @kanhasingh728
    @kanhasingh728 4 ปีที่แล้ว +63

    What a timing man. I was just thinking of starting web scraping 😁
    Great video btw

  • @CSEngineerInsider
    @CSEngineerInsider ปีที่แล้ว +1

    Best video in whole TH-cam.

  • @blossomkalabaw7941
    @blossomkalabaw7941 2 ปีที่แล้ว +3

    this is really great Tim, thanks a lot, very concise and up to details, less garbage talks, very focused on the topic.
    thanks

  • @karandewani6614
    @karandewani6614 4 ปีที่แล้ว

    I just made a tinder auto swiping bot yesterday and was thinking to learn more about selenium and this video pops up. Great timing and awesome videos man! Keep up the good work.

  • @alpixfere
    @alpixfere 10 หลายเดือนก่อน +6

    right after i finished the course, i wrote a programm that will spam join a kahoot game that crashes game whenever teacher gives out the code, and i'll let my programm pick some inappropreate name, anyway love your courses

  • @SOMEGUY-ci8nr
    @SOMEGUY-ci8nr 2 ปีที่แล้ว

    finally someone that knows what they are talkin about i been searching for ever for a video like this :)

  • @mreverything4663
    @mreverything4663 4 ปีที่แล้ว +69

    For this tutorial series, could we build some sort of notification system that uses web scraping?

    • @omgcyanide4642
      @omgcyanide4642 3 ปีที่แล้ว +2

      Yes I made notifications straight to my phone with spontit or discord and use web scraping you can even permanently change variables with txt files and other cool stuff

    • @SquidBeats
      @SquidBeats 3 ปีที่แล้ว +1

      Jesus Christ is God and is the only way. Hell is real whether you believe it or not.

    • @halamadrid5238
      @halamadrid5238 3 ปีที่แล้ว

      @@omgcyanide4642 how did you do this?

    • @barabara9855
      @barabara9855 3 ปีที่แล้ว

      @@SquidBeats somebody successfully made a bot

  • @TyroneSmithTDS
    @TyroneSmithTDS 4 ปีที่แล้ว +2

    I've been waiting for this tutorial from you for so long. Thanks Timmmm!!!!

  • @moresmartsolutions9480
    @moresmartsolutions9480 4 ปีที่แล้ว +6

    We have been waiting for this, finally!!!! So thanks Sir
    Let tech with Tim

  • @aniketshinde4416
    @aniketshinde4416 3 หลายเดือนก่อน

    So concise and to the point. Makes it look easy.

  • @ofi2187
    @ofi2187 2 ปีที่แล้ว +1

    So clear so clean. Thank you sir, there is no one else who explains it as well as you.

  • @jammincoder
    @jammincoder 3 ปีที่แล้ว +9

    Great explanations, easy to follow, just what I needed to get started. Definitely earned my subscription. Thanks man.

  • @akberkhan6329
    @akberkhan6329 4 ปีที่แล้ว +6

    Awesome man, thanks for the vid! Took me a while to figure out why I was getting an error message in my terminal...It's super important that the PATH = "/Applications/chromedriver" (this is where it was for me) for Mac user is written correctly, otherwise it won't be able to find the chromedriver ... Anyways great video, will be watching the other vids.. nice work

    • @loralora8395
      @loralora8395 4 ปีที่แล้ว

      very important indeed. Took me ages but felt so relieved in the end

    • @karmendurbin
      @karmendurbin 3 ปีที่แล้ว

      It's been taking me forever to find this out too! LOL

  • @vineethrao60
    @vineethrao60 3 ปีที่แล้ว +25

    if your code dosnt work put an r before the string in path for example- r"C:\Program Files (x86)"

    • @ManInBlack718
      @ManInBlack718 3 ปีที่แล้ว +1

      Thanks, but why does this work?

    • @ManInBlack718
      @ManInBlack718 3 ปีที่แล้ว

      @@williamanstett5305 thanks!

    • @apotatowithfingers1572
      @apotatowithfingers1572 3 ปีที่แล้ว

      do you know how to get the path to a file on a chromebook?

    • @ryanfernando8330
      @ryanfernando8330 3 ปีที่แล้ว

      I found this immensely helpful, I used to have to put double slashes in the file path every time.

    • @manbearpig4702
      @manbearpig4702 3 ปีที่แล้ว

      legend

  • @akremgomri9085
    @akremgomri9085 9 หลายเดือนก่อน +6

    I enjoyed the video so much, but there is an update for newer versions of chrome.
    You shoould do this :
    from selenium import webdriver
    PATH = "C:\\Program Files\\chromedriver-win64\\chromedriver.exe"
    cService = webdriver.ChromeService(executable_path=PATH)
    driver = webdriver.Chrome(service = cService)
    Instead of passing the executable_path to Chrome() directly.

    • @dekisatria1233
      @dekisatria1233 7 หลายเดือนก่อน

      thanks, it help a lot. the chrome web driver change a lot. i think tim need to rework this tutorial

  • @2011Filmer
    @2011Filmer 4 ปีที่แล้ว +7

    Huge fan! Keep up the good work :)

  • @nerdtowncity5930
    @nerdtowncity5930 4 ปีที่แล้ว +3

    I’ll definitely be following these videos! Will help with my work!!

  • @MrJcc444
    @MrJcc444 11 หลายเดือนก่อน +10

    this has some potential but no matter what I tried it doesn't work , tried it on the mac .windows same issue 'str' has no capabilities and nowhere to go from there

  • @king_canutooo
    @king_canutooo 3 ปีที่แล้ว +1

    I learnt python from you . Thank you very much Tim .

  • @NishantSingh-px3jm
    @NishantSingh-px3jm 4 ปีที่แล้ว +7

    You can install chrome driver by using "chocolaty" by the command " choco install chromedriver" it will install the chrome driver if you have chocolaty installeed and then you will not have to add the path each time. The code will be as:-
    from selenium import webdriver
    driver = webdriver.Chrome()
    driver.get("google.com")

    • @ownzuall
      @ownzuall 4 ปีที่แล้ว

      If you want to completely automate the process, chocolaty have sample of script to download it either by powershell or cmd, so you can make a cmd script that downloads chocolaty and then tells it to download the next thing.

    • @NishantSingh-px3jm
      @NishantSingh-px3jm 4 ปีที่แล้ว

      @@ownzuall yep I know but I that that would be a bit difficult for someone who has no experience in batch files

  • @user-du8hf3he7r
    @user-du8hf3he7r ปีที่แล้ว +5

    Update for Selenium4:
    Replace:
    driver = webdriver.Chrome(PATH)
    With:
    from selenium.webdriver.chrome.service import Service
    service = Service(PATH)
    options = webdriver.ChromeOptions()
    driver = webdriver.Chrome(service=service, options=options)

  • @powerb_i
    @powerb_i 4 ปีที่แล้ว +5

    Love your videos Tim, so well presented. Thank you you're really helping me as a newbie Python programmer.

  • @lawrencedoliveiro9104
    @lawrencedoliveiro9104 3 ปีที่แล้ว +3

    1:48 Debian includes standard packages for python3-selenium, chromium-driver and phantomjs. Both the latter two are listed as dependencies for the first one.

  • @akshatsingh7286
    @akshatsingh7286 4 ปีที่แล้ว +3

    Great Video man!! Please do make more videos on this! Also make a video on how to setup Sublime text

  • @_Xyr
    @_Xyr 4 ปีที่แล้ว +4

    I was looking for a selenium tutorial and couldn't find one that was atleast a year ago, Please upload the next parts asap
    Also amazing video, Keep up the good work

  • @preetirani8272
    @preetirani8272 ปีที่แล้ว +3

    can someone please share the link for download the chrome driver for chrome version 118x

  • @markbrown5365
    @markbrown5365 3 ปีที่แล้ว +9

    "Chromedriver needs to be in PATH" ERROR keeps poping up for me. I already added them to my system environment. Still the same error. Any advice?

    • @Ohamskillua
      @Ohamskillua 2 ปีที่แล้ว

      Bro copy the path, from your filemanager, and do // instead of /.

    • @uskumru3106
      @uskumru3106 2 ปีที่แล้ว

      Try this:
      PATH=(r"C:\Program Files\dowload/chromedriver.exe")
      Basically PATH=(r"file_location/file_name.exe")

    • @mananmalhotra792
      @mananmalhotra792 2 ปีที่แล้ว

      Use r’filelocation\\filename’

    • @markbrown5365
      @markbrown5365 2 ปีที่แล้ว

      @@mananmalhotra792 thank you for answering my post. What does the "r" function do exactly & why do dome coding tutorials like this one not have them? It's confusing. When should/ shouldn't I use it?

    • @jimybobjim
      @jimybobjim 2 ปีที่แล้ว

      @@markbrown5365 for example, if I wanted the string ‘something
      ’ it would create the string ‘something’, but it would have a new line at the end. If instead I did r’something
      ’, it would just be ‘something
      ’.

  • @leoguitar2058
    @leoguitar2058 4 ปีที่แล้ว +4

    Linux/MacOS:
    pip = install modules on python 2
    pip3 = install modules on python 3

    • @masondigiorgio7759
      @masondigiorgio7759 4 ปีที่แล้ว

      Leonardo Neute If your python is up to date pip would also be python 3, since python 2 has been phased out. At least this is the case on my Linux machine.
      Also you can run pip -V to make sure you are using the correct version.

    • @leoguitar2058
      @leoguitar2058 4 ปีที่แล้ว

      ​ Mason DiGiorgio in that case you should have only one version of python installed, using ubuntu

  • @alex17k18
    @alex17k18 ปีที่แล้ว +3

    I tried it like you did here 9:30, but why does it not show the chrome window when I run the code, instead the chrome opens for a sec and quits... I did everything right.

  • @programming_hut
    @programming_hut 4 ปีที่แล้ว +6

    Could you please start a new series after this where you will teach
    Basic to advance projects with ML in py
    Btw thanks for such a good content

    • @pawandeep313
      @pawandeep313 4 ปีที่แล้ว +4

      It would be the best day ;D

    • @computedprogramming4705
      @computedprogramming4705 4 ปีที่แล้ว +1

      yes also agree with your statement

    • @angel-ig
      @angel-ig 4 ปีที่แล้ว +2

      th-cam.com/video/WFr2WgN9_xE/w-d-xo.html

    • @ekrem_dincel
      @ekrem_dincel 4 ปีที่แล้ว

      Look at Sentdex channel

  • @victordvickie
    @victordvickie 4 ปีที่แล้ว +4

    I was expecting this tut

  • @vazp3
    @vazp3 7 หลายเดือนก่อน +4

    May 2024: Following the instructions and using
    "
    from selenium import webdriver
    service = webdriver.ChromeService(executable_path = 'C:\Program Files (x86)\chromedriver.exe')
    driver = webdriver.Chrome(service=service)
    "
    worked for me, otherwise an error appears: " 'str' object has no attribute 'capabilities' "

    • @sjsjakskass
      @sjsjakskass วันที่ผ่านมา

      it shows unicode error smthng and i fixed it by adding (path= r'C:\Users .....the path ..')

  • @santoryu8940
    @santoryu8940 ปีที่แล้ว +4

    Hello everyone! I am getting this error: "AttributeError: 'str' object has no attribute 'capabilities' ". Has anyone encountered the same error message? If so, may I ask how did you fix it?

    • @MissGurung_AI
      @MissGurung_AI ปีที่แล้ว +4

      replace
      driver = webdriver.Chrome("PATH")
      with
      driver = webdriver.Chrome()

    • @НиколаИванов-ю4х
      @НиколаИванов-ю4х ปีที่แล้ว +2

      ​@@MissGurung_AI Had the same error. Thank you

    • @gardengnomefan
      @gardengnomefan ปีที่แล้ว

      @@MissGurung_AI I've also had the same issue, but when I do that I get an error "Error getting version of chromedriver 115. Retrying with chromedriver 114 (attempt 1/5)". And it opens like a debug? version of chrome, while I'd want it to open with my regular chrome browser.
      Any ideas? I'm running chrome *.171, but the chromedriver I downloaded id *.170. Is that the issue?

  • @dokwonsuh
    @dokwonsuh 3 ปีที่แล้ว +4

    Hey Tim. Great videos series! I am really learning a lot - thank you so much. One idea for a future video might be how to set up headless Selenium on a remote server :)

  • @alextorres9750
    @alextorres9750 2 ปีที่แล้ว

    Wow...just amazing...and finally proper English spoken :)

  • @elishabt662
    @elishabt662 4 ปีที่แล้ว +4

    Tried the same and i got this error:
    12296:26672:0420/163936.459:ERROR:browser_switcher_service.cc(238) XXX Init()
    Any help would b of great use

    • @truog91
      @truog91 4 ปีที่แล้ว +1

      i got this too

  • @brianscalabrine6481
    @brianscalabrine6481 4 ปีที่แล้ว +3

    when i try to do import selenium, it won’t work. import shows up as text not a command. help

  • @andrewv8548
    @andrewv8548 4 ปีที่แล้ว

    Selenium is insanely powerful. Super fun to use.

  • @Arjunsiva
    @Arjunsiva 4 ปีที่แล้ว +9

    If anybody is getting the error:SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
    Add an 'r' before the path PATH = r"C:\"

    • @thelifeofsarath
      @thelifeofsarath 3 ปีที่แล้ว

      Thank you!

    • @tobortwo3697
      @tobortwo3697 3 ปีที่แล้ว

      still didn't help

    • @tobortwo3697
      @tobortwo3697 3 ปีที่แล้ว

      @GucciVittion thanks, that's helpful. it wasn't my problem actually, but I got it fixed so it's okay. (solution: add executable path=r before the driver, but not for PATH)

  • @callme_xoroz
    @callme_xoroz 11 หลายเดือนก่อน +3

    msg = f"Unable to obtain driver for {options.capabilities['browserName']} using Selenium Manager."
    ^^^^^^^^^^^^^^^^^^^^
    AttributeError: 'str' object has no attribute 'capabilities'

  • @abhilashtu3653
    @abhilashtu3653 4 ปีที่แล้ว +6

    Hi Tim thank you for your help
    And I have a question
    Why sometimes selenium act weird, like sometimes the send keys and click method will not work even if I have no errors. This is a huge strange problem it not true in every case if I had a script which not working because of the send keys issue but I copy the code and paste in a another file it worked , why is this?

    • @redbutton_photo
      @redbutton_photo 4 ปีที่แล้ว +1

      I ran into something similar. Rerun PIP import selenium. Also make sure you're running import selenium from webdriver

  • @ramizquliyev394
    @ramizquliyev394 4 ปีที่แล้ว

    Man!!! You are a legend. Actually I already downloaded selenium and webdriver but You have answered all problems that I was straglling when I was trying to download. You deserve more than subscribtion and likes

  • @LukmanulHakim1999
    @LukmanulHakim1999 4 ปีที่แล้ว +3

    need this :V keep upload

  • @deepakmalhotra2880
    @deepakmalhotra2880 3 ปีที่แล้ว

    Great video which needs to go viral. The power to do this stuff is pretty sick

  • @AnthonHax
    @AnthonHax 3 ปีที่แล้ว +10

    Nice tutorial! I used geckodriver and it works fine too; but path/'driver' variables must be different with gecko:
    driver = webdriver.Firefox(executable_path=r'PATH\geckodriver.exe')
    took me a while to find out, so I'll just leave it here.

    • @btraboulsi
      @btraboulsi 2 ปีที่แล้ว +1

      It was driving me crazy hahahaha. Thanks for the tip!

  • @aniket7512
    @aniket7512 ปีที่แล้ว +4

    If chrome closes immediately after launching then add this to the code at end
    while(True):
    pass

    • @NourSoltani-mh1xh
      @NourSoltani-mh1xh ปีที่แล้ว +2

      For those who watch this video years after it posted. I think a few things are changed:
      1) you do not need to download the web driver anymore. Just use
      driver = webdriver.Chrome()
      2) if you open a page and it closes immediately, add the following (assuming you are using Chrome as well):
      from selenium.webdriver.chrome.options import Options
      options = Options()
      options.add_experimental_option("detach", True)
      driver = webdriver.Chrome(options= options)
      These are two main issues I had when I was coding along. Took me sometime to figure out a solution. Hope it helps.

  • @k2icc
    @k2icc 4 ปีที่แล้ว +4

    WebDriverException: Message: chrome not reachable

    • @lovely-shrubbery8578
      @lovely-shrubbery8578 4 ปีที่แล้ว

      I couldn't find the particular exception, but I'd look through this selenium-python.readthedocs.io/api.html#module-selenium.webdriver.chrome.webdriver if no luck I'd try the Firefox driver

    • @ymcho4037
      @ymcho4037 4 ปีที่แล้ว

      what is your PATH

    • @k2icc
      @k2icc 4 ปีที่แล้ว

      @@lovely-shrubbery8578 I believe that I used another path withing a folder, so that worked out fine. Now, I get empty results when scraping from tradingeconomics.com/commodities tables.
      A little progress, but now if arrays, those results come back empty. If anyone can try getting data from those tables, what will be great. Also tried bs4 to get into the classes of td, tr, etc. No results.. Thanks.

  • @Lerklinten
    @Lerklinten 3 ปีที่แล้ว

    ... actually had some issues setting up selenium, this little video helped me, so Thanks..

  • @herrdesai6853
    @herrdesai6853 4 ปีที่แล้ว +9

    having error as in "chromedriver.exe"

    • @akittensjournal
      @akittensjournal 4 ปีที่แล้ว

      Same here . Your's resolved?

    • @ronkzedonk
      @ronkzedonk 4 ปีที่แล้ว

      @@akittensjournal check the description (second link)

    • @serene9228
      @serene9228 4 ปีที่แล้ว

      same

    • @katharinaprzeperska5624
      @katharinaprzeperska5624 3 ปีที่แล้ว

      @@ronkzedonk The description of what? Chrome driver? Nothing useful in there or I can't see it. How did you solve the error?

  • @e5caflowne500
    @e5caflowne500 4 ปีที่แล้ว

    Proud to be a Patreon of TechWithTim!

  • @pickledparsleyparty
    @pickledparsleyparty 4 ปีที่แล้ว +51

    Real talk: Is there anyone out there who's advanced enough to want to use Selenium but basic enough that they don't know what Pip is nor how to install Python packages?

    • @loganlogan2411
      @loganlogan2411 4 ปีที่แล้ว +7

      no

    • @yay69
      @yay69 4 ปีที่แล้ว +2

      me(?

    • @mr2_mike
      @mr2_mike 2 ปีที่แล้ว +1

      Yep!

    • @doomstarks182
      @doomstarks182 2 ปีที่แล้ว +1

      Yeah so I know pip is what you use to install python packages? But it’s real easy for me to forget and I actually had to look up what it meant bc I was having problems with pathing and needed to fix. Installing the packages are easy but i had to to learn about relative and absolute paths and I watched a video and learned that my files locations were all jacked up and the video fixed that issue for me.
      I’m learning on my own and at my new job we do some data entry for new hires. We have to get id copy paste from one form to another. One of the big things is when the forms don’t match it kicks an error report and we manually go through looking for the mismatch. We have to get the new hires to fill out a paper and then we trial by error find the mistake.
      My first day I was like woah this is tedious and time consuming I bet I could find a way to get the information from the forms compare them and where they don’t match have the correct info put into the form. So here I am learning how to do that :)

    • @obamacheeseburger2046
      @obamacheeseburger2046 2 ปีที่แล้ว

      Basically me

  • @mutlucaniltir
    @mutlucaniltir 2 ปีที่แล้ว

    This was the best tutorial I've seen on youtube so far. Thank you very much. Hope you get what you deserve with your effort.

  • @dillonmears6696
    @dillonmears6696 2 ปีที่แล้ว +1

    I work in education and the quality of your tutorials is better than 90% of the teachers I have worked with! Keep up the awesome work!

  • @gabymaymo8482
    @gabymaymo8482 2 ปีที่แล้ว

    This is the tutorial i was looking for, very clear, you have a new subsc

  • @michaelbolshakov5718
    @michaelbolshakov5718 ปีที่แล้ว +2

    For those whose driver closes immediately, just when you create your driver, set the keep_alive option to True (e.g. driver = webdriver.Firefox(url="...", options=..., keep_alive=True))

    • @پارساوالیزادهاردلان
      @پارساوالیزادهاردلان ปีที่แล้ว

      Thank you stranger.

    • @friendlygodzilla
      @friendlygodzilla ปีที่แล้ว

      Thank you so much dude

    • @cagatay2778
      @cagatay2778 ปีที่แล้ว +1

      its not working, stil close

    • @michaelbolshakov5718
      @michaelbolshakov5718 ปีที่แล้ว

      ​@@cagatay2778 i guess they fixed something in new versions, because i doesn't work for me now either

    • @NourSoltani-mh1xh
      @NourSoltani-mh1xh ปีที่แล้ว

      @@cagatay2778 For those who watch this video years after it posted. I think a few things are changed:
      1) you do not need to download the web driver anymore. Just use
      driver = webdriver.Chrome()
      2) if you open a page and it closes immediately, add the following (assuming you are using Chrome as well):
      from selenium.webdriver.chrome.options import Options
      options = Options()
      options.add_experimental_option("detach", True)
      driver = webdriver.Chrome(options= options)
      These are two main issues I had when I was coding along. Took me sometime to figure out a solution. Hope it helps.

  • @cass_666
    @cass_666 3 ปีที่แล้ว

    Short and sweet, you always have excellent videos.

  • @ДмитрийЕвстратов-э3м
    @ДмитрийЕвстратов-э3м 3 ปีที่แล้ว +1

    This is a top tier tutorial series! Thank you a lot, you're a legend dude!

  • @JuanPerez-cs1gx
    @JuanPerez-cs1gx 6 หลายเดือนก่อน

    Thanks for explaining pip. I think people doing tutorials or guides for whichever language or framework are kind of allergic to explaining package managers and assume that everyone knows what they are talking about.

  • @luisemilioogando
    @luisemilioogando ปีที่แล้ว

    Even Though is an old version o selenium, Im impressed with the way you teach.. Great Job 👏

  • @dreiigHiveSGClips
    @dreiigHiveSGClips 3 ปีที่แล้ว

    thank you finally this tut has been the first to actually work

  • @lod7635
    @lod7635 2 ปีที่แล้ว

    this gives possibility in infinite amount of things, thank you so much.

  • @cmmmmmmmw
    @cmmmmmmmw 2 ปีที่แล้ว +23

    This no longer works as passing in the executable path has been deprecated in favor of passing in a service object. This is how your code should look now:
    from selenium import webdriver
    from selenium.webdriver.chrome.service import Service
    x=Service('C:\Program Files (x86)\chromedriver.exe')
    driver = webdriver.Chrome(service=x)

    • @sandraugochukwu9675
      @sandraugochukwu9675 2 ปีที่แล้ว +1

      Thanks but this didn't work for me either, I need help.

    • @shrektum2720
      @shrektum2720 2 ปีที่แล้ว +1

      thank you bro, you're a G, worked for me

    • @eugenmalatov5470
      @eugenmalatov5470 ปีที่แล้ว

      Thanks a lot, I have just had to find out about this myself. Great to see the problem here confirmed. Should be sticky note

  • @0myjoe
    @0myjoe 3 ปีที่แล้ว

    thank you so much. This is about the only tutorial I cant find out there that makes sense and goes through each move step by step. Defo gonna keep coming back to this channel

  • @bryanwelch766
    @bryanwelch766 4 ปีที่แล้ว

    Selenium setup quickly and clearly explained. Thank you!

  • @MrMarkgyuro
    @MrMarkgyuro 3 ปีที่แล้ว +1

    big thanks, it is really good to see that you explain everything clearly and step are not left out : )

  • @isabelalvarez4467
    @isabelalvarez4467 2 ปีที่แล้ว

    This video is gold! I have needed to scrape in two different computers and i´ve come back to install everything, cause its so well explained. pls keep it online forever (L)

  • @jampavy6446
    @jampavy6446 2 ปีที่แล้ว

    Really whatever this man teaches sits in my brain very nicely. Thank you so much and I like your vids very much.

  • @ankushsarkar1746
    @ankushsarkar1746 4 ปีที่แล้ว +1

    Holly shit dude , I discovered selenium like 3 days back and u maikin this. Amazing man

  • @franciscocalixtoaudi1142
    @franciscocalixtoaudi1142 3 ปีที่แล้ว

    Bro everything I search for you have a tutorial, great work

  • @Owend-xz9vr
    @Owend-xz9vr 3 ปีที่แล้ว

    thank you soooooo much bro u dont know how much i spent looking for selenium thx

  • @aebel.shajan
    @aebel.shajan 11 หลายเดือนก่อน

    wow this is very concise and clear. you have great communication skills :D