Mastering Browser Automation with Python and Selenium

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • In today's episode of learn Python by doing we explore browser automation using Selenium and control the Google chrome browser to automatically login with Python. This is part 1 of 2 scraping video, make sure to subscribe if you haven't already

Комментарии • 105

  • @joaogrizonic4092
    @joaogrizonic4092 4 года назад +12

    I started leaning python a few weeks ago and used selenium, it took me hours to understand what you explained in less than 15’, great job!!

    • @MakeDataUseful
      @MakeDataUseful  4 года назад +6

      Thank you! I like to create a mix of learning by doing and not hiding my errors, it's the best way to learn!

  • @RetroPandroo
    @RetroPandroo 2 года назад +4

    For anyone having issues at the find_element step, I had to slightly modify my code to this, where you have to input the type (class name, id, etc.) and value differently:
    driver.find_element(by="id", value="connect_button")

    • @leewarsamesage2212
      @leewarsamesage2212 2 года назад +1

      Thank You for sharing this, couldn't find this anywhere!!

    • @ERA659
      @ERA659 Год назад

      thank you bro

    • @MakeDataUseful
      @MakeDataUseful  Год назад

      Thanks for contributing to the community @RetroPandroo much appreciated!

  • @adnanzafar5385
    @adnanzafar5385 4 года назад +4

    You are amazing MAN. Thanks for your efforts.

  • @anupyadav9541
    @anupyadav9541 2 года назад +1

    It helped to crack my project milestone. Thanks a lot. love your support.

  • @seanradford3226
    @seanradford3226 4 года назад +4

    This is amazing! Thank you for explaining it in a way that makes it easier to understand! Keep the great content coming!

  • @vitorxavier8615
    @vitorxavier8615 4 года назад +1

    This video help me so much, I'm newbie on python and dont speak english very well, but I can understand everthing and make my web scrapping!

  • @bibybsa7921
    @bibybsa7921 11 месяцев назад

    ycoolest guy in youtube.
    Really liked your video, well explained, I paid for a "Excel automation with Python course" and it was just xpath scraping (1 line of code) and basic openpyxl, which pandas can do better. Your video is free and much better, keep up the hard-work!

  • @michaelrobbins7444
    @michaelrobbins7444 4 года назад +1

    You are an incredible instructor!!! I've been learning the tools to scrape for the last couple of years and this is the best instruction yet. Would love to see a video on how and where you store the large data sets that you scrape.

    • @MakeDataUseful
      @MakeDataUseful  4 года назад

      Hey good thinking! I'll add it to my list, with so many different options maybe I'll share a different method each week 🤙

  • @travelselects272
    @travelselects272 4 года назад +1

    Thank you Adam! So far I must say your tutorials rank among the best in the subject matter. At this rate you will hit 2k plus subscribers by year-end 2020. Congratulations!

  • @priyandahiya7234
    @priyandahiya7234 Год назад +1

    you are awesome and really just love your positivity. I just hope everyone around us has a person like you to teach.

  • @mhh9703
    @mhh9703 Год назад +1

    this is amazing i wish i watched this years ago

    • @MakeDataUseful
      @MakeDataUseful  Год назад +1

      More to come! Working on some longer videos to go through data collection, cleanup and analysis/outputs. Stay tuned!

    • @mhh9703
      @mhh9703 Год назад

      @@MakeDataUsefulSounds exciting, can't wait 💻

  • @jonathanalphonso2035
    @jonathanalphonso2035 4 года назад

    Very clear video! Selenium seems to be the number one choice for web scraping but there are very few modern tutorial videos on this. The web driver manager also takes away a huge headache I used to have with the web driver.

  • @jeffsinason4336
    @jeffsinason4336 4 года назад +1

    Congrats. You deserve it. You’re doing great work.

  • @infinityfun9160
    @infinityfun9160 2 года назад +1

    Awesome man....i really learnt something frm u

  • @frankp.2449
    @frankp.2449 3 года назад

    I’ d been messing with bs4 straight getting a “419 Page Expired” error in the soup… Looking forward to trying starting out w/ Selenium, thanks this is great 🙏👌

    • @MakeDataUseful
      @MakeDataUseful  Год назад

      Selenium is always a great help, appears as a standard browser to the site

  • @christoph231090
    @christoph231090 4 года назад +1

    great video again. looking forward to part two.

  • @thatoneguy1821
    @thatoneguy1821 4 месяца назад

    THANK YOU!!!
    This is sooooo helpful

  • @JohnBrute
    @JohnBrute 4 года назад +1

    This is awesome, Adam! Thanks for providing these incredible resources. Do you use any apps to help you memorise the elements of the selenium package (such as Anki?) Also congrats on reaching 1k subscribers and completely blowing your goal out of the water.

    • @MakeDataUseful
      @MakeDataUseful  4 года назад +1

      Thanks John! I'm blown away by how quickly we reached 1k 😃 I haven't been using any apps but checking out Anki now.

  • @DIY-Investors
    @DIY-Investors 3 года назад

    You made that very clear and easy to understand... thank you. Five stars from me! *****

  • @austinhomolka
    @austinhomolka 3 года назад

    Really easy to follow video. I really appreciate the help!

  • @jpaiva7934
    @jpaiva7934 3 года назад +1

    Also, I'm sure you are already familiar with that, but you shouldn't use time to wait for elements to wait, you should use the selenium wait features instead. On a slow internet that code could break.

    • @MakeDataUseful
      @MakeDataUseful  3 года назад +1

      Thanks byjoseh! 100% agree, I'll make sure to use the selenium wait in future videos. I appreciate the feedback!

  • @abhineetsingh101187
    @abhineetsingh101187 2 года назад

    Amazing stuff. Thanks a lot for making this video.

  • @nibraslm
    @nibraslm 3 года назад

    thansk u man, this help me weary mhch THANK U LUV FROM CHENNAI

  • @alhamdialshamsi6842
    @alhamdialshamsi6842 3 года назад

    Thank you this is amazing and i would like to know more about python i am a new to this and i really wanna know more

    • @MakeDataUseful
      @MakeDataUseful  Год назад

      How's the python learning going Alhamdi? Still keeping at it?

  • @thewhiterabbit661
    @thewhiterabbit661 3 года назад

    SO SHIFT ENTER ON THAT!!! thank you!

  • @jobluemann
    @jobluemann 3 года назад

    Great video thanks, you made it easy to understand

  • @ziarahman7877
    @ziarahman7877 4 года назад +2

    Subbed.

    • @MakeDataUseful
      @MakeDataUseful  4 года назад +1

      Thank you!

    • @ziarahman7877
      @ziarahman7877 4 года назад

      @@MakeDataUseful Thank you for such an entertaining and informative tutorials and videos. I really enjoyed your reactions when you mess up.

  • @venkatasivanagababu64
    @venkatasivanagababu64 3 года назад +1

    thanks bro

  • @dylanmatheson7859
    @dylanmatheson7859 3 года назад +1

    As a final capstone project, I am attempting to create a project on Jupyter Notebook that will retrieve live market data(e.g share indexes,currency values,etc). Is selenium the best for this in comparison to scraper or Bs4

    • @MakeDataUseful
      @MakeDataUseful  3 года назад +1

      Hey Dylan, I would recommend checking out what API's are available and simplify the project and just use python requests. I seem to recall there even being a python package you can pip install that collects data direct from Yahoo finance. Let me know how you go!

    • @dylanmatheson7859
      @dylanmatheson7859 3 года назад

      @@MakeDataUseful Thanks for the suggestion, ive made use of pandas_datareader to collect data from the yahoo website. Sill having some issues with regards to converting the data in a more readable graph with matplotlib, but making progress none the less. Thanks once again

  • @dmk8791
    @dmk8791 3 года назад +1

    You can import plugins using Selenium. I use ublock to block ads

    • @MakeDataUseful
      @MakeDataUseful  3 года назад

      Awesome!! Thanks for the tip! Myself and the community appreciates it.

  • @phongkuBisous
    @phongkuBisous Год назад

    How do you log into a website where access is denied from selenium?

  • @siddhant4882
    @siddhant4882 4 года назад +1

    just awesome

  • @gainsbrah9831
    @gainsbrah9831 3 года назад

    Thanx bro thanx alot

  • @dnullify100
    @dnullify100 3 года назад +1

    Hey just checking, where'd you go? Would love more of this.

    • @MakeDataUseful
      @MakeDataUseful  3 года назад

      Hey! Thanks for checking in, new content dropping soon 🙂

  • @velvetcasuat
    @velvetcasuat 4 года назад +1

    Yey ... good job Adam. Do you have any tips on getting accepted on upwork ?

    • @MakeDataUseful
      @MakeDataUseful  4 года назад +1

      Hi Velvet, it is becoming harder and harder to get approved these days. My advice would be to select every subcategory of skill that applies to you and if you have got some past projects you are happy to share host them on GitHub as a bit of a portfolio. Let me know how you go!

    • @velvetcasuat
      @velvetcasuat 4 года назад

      @@MakeDataUseful Thanks Adam ... i'm working on my portfolio now ... I've read that they also prefer a personal mail over gmail or other mail services .

  • @Predia_TV
    @Predia_TV 3 года назад

    I get SyntaxError: invalid syntax when I get to driver.get(url)

  • @nilswinkler2752
    @nilswinkler2752 3 года назад

    Hey how can i login multiple accounts from a csv file?

  • @rajahussain1172
    @rajahussain1172 3 года назад

    Dear Your content is awesome!... I am using google colab on google chrome browser. I encounters error in the line code: driver = webdriver.Chrome(ChromeDriverManager().install()). error says "ValueError: Could not get version for Chrome with this command: google-chrome --version || google-chrome-stable --version". I installed & imported required packages and dependancies such as "!pip install selenium
    !pip install webdriver-manager". Dear, your technical help is required to overcome this issue!!!!!!

  • @rbmz1712
    @rbmz1712 2 года назад

    Hi! May I ask how to click a login button that is in style="display:none;"? Thank you!

    • @MakeDataUseful
      @MakeDataUseful  2 года назад

      Does it have an ID? Finding the element by the ID might be the way to go in this example

    • @rbmz1712
      @rbmz1712 2 года назад

      ​@@MakeDataUseful I still get an error but thank you for your reply. I tried your tutorial on other websites and it worked. I didn't know it doesn't need countless codes to log in to a website with python. Your video is really helpful! 😊

    • @farid-frederick
      @farid-frederick Год назад

      @@rbmz1712 how the hell a button to login not displayed

  • @CodeRed-xj3ut
    @CodeRed-xj3ut 4 года назад

    Can you help me im having problem on blocking a url from loading on the background how can i do that using python and selenium?

  • @vaibhav3852
    @vaibhav3852 4 года назад +1

    well done

    • @MakeDataUseful
      @MakeDataUseful  4 года назад

      Thank you!

    • @vaibhav3852
      @vaibhav3852 4 года назад

      @@MakeDataUseful chrome driver manager really helped me
      first i had to mess with the driver and other things and when new update comes out i had to badly mess with it but now it manages for me easily

  • @sandeepyadav1478
    @sandeepyadav1478 4 года назад

    can u make it live? coz it gives some unknown error. And thank u for video.

  • @jakewilliamson9141
    @jakewilliamson9141 3 года назад

    Hey, i recently have been working on my project for gmail login automation using selenium , but whenever i run the code gmail wont allow me sign and and will say - "This browser or app may not be secure. Learn more
    Try using a different browser. If you’re already using a supported browser, you can refresh your screen and try again to sign in." please help bro much appreciated :)

    • @ayoubdriouch5843
      @ayoubdriouch5843 3 года назад

      You have to disable the tow step verification in your google account

  • @SLindberg
    @SLindberg 3 года назад

    Thank you for a very great video. How to handle https ssl certificate with this python code?

  • @mukundbankar3519
    @mukundbankar3519 2 года назад

    When I open chrome using driver it gets closed automatically.

    • @MakeDataUseful
      @MakeDataUseful  Год назад

      That's very strange, is there any specific error?

  • @csimu
    @csimu 2 года назад

    Hi! How do I write code that, if my username is incorrect, will try to sign me in with a different username? Can you help me please?

    • @farid-frederick
      @farid-frederick Год назад

      If (exist this element that show incorrect) :
      Input another username

    • @MakeDataUseful
      @MakeDataUseful  Год назад

      Step one is to purposely get the username wrong, then inspect the element that appears to indicate "hey that username is incorrect" then run an if statement that looks for that element and does something different. Interesting question, I hope your not hacking Csimu :P

    • @farid-frederick
      @farid-frederick Год назад +1

      @@MakeDataUseful yeah he seems sus, but it takes a billion times to do traditional bruteforce :/

  • @tejaganta2039
    @tejaganta2039 4 года назад

    What to do if website is having capitcha?!

  • @nileshsingla1058
    @nileshsingla1058 3 года назад

    How could I overcome CAPTCHA in login for site I am doing?

    • @MakeDataUseful
      @MakeDataUseful  3 года назад

      It's a tough one Nilesh, Captcha is design to stop automated access. One work around I have come up with is moving to a semi automated script that stops and waits for user input to solve the captcha. Not ideal but sometimes it's all we can do. If you are happy to share the site let me know and I can have a look.

  • @sve446
    @sve446 3 года назад

    Hi,
    How can i contact you are you have any email on which i can contact you ?
    I need litle help on the relationship with this video (about scrapping web site with class inside class).
    Thanks in advance!
    Best regards

  • @vaibhav3852
    @vaibhav3852 4 года назад

    where can i get code

    • @jimcarroll9738
      @jimcarroll9738 4 года назад +2

      I've transcribed it to a gist, although there's something to be said for trying to transcribe it yourself. Muscle memory, making mistakes, etc. gist.github.com/quadespresso/864b3157785a7d14ac2147a601d9e63e
      Adam, feel free to remove my comment or whatever.

    • @MakeDataUseful
      @MakeDataUseful  4 года назад +1

      Thanks for taking the time to transcribe Jim, really appreciate it and 100% agree with benefit of writing the code each time.

    • @vaibhav3852
      @vaibhav3852 4 года назад

      @@jimcarroll9738 ya I too agree but sometime it is more better to see from somewhere else
      It was giving error when importing driver manager but I had installed it
      Can u do this on drive
      I had just started coding and not much into it so I dont know how to use git

    • @jimcarroll9738
      @jimcarroll9738 4 года назад

      @@vaibhav3852 you need to do `pip install webdriver-manager selenium` *before* starting Jupyter. If that alone is giving you troubles, then you've got something misconfigured with your Python setup. Trying to troubleshoot that in RUclips comments will prove to be challenging for everyone involved. Recommend you try to search that error online to see what you get back. Failing that, take the question over to a forum such as Stack Overflow.

  • @SLindberg
    @SLindberg 3 года назад

    Thank you for a very great video. How to handle https ssl certificate with this python code?