Python Tutorial: Browser Automation & Web Scraping with Selenium - Part 2

Sdílet
Vložit
  • čas přidán 15. 08. 2020
  • In part 2 we auto-login with Selenium then use Python BeautifulSoup to scrape the contents of the pages to create a Pandas dataframe at the end.
    Part 1 available here - • Mastering Browser Auto...

Komentáře • 76

  • @trinb1
    @trinb1 Před 3 lety +7

    I learnt more in 30mins than what I learned in 4+ hours from studying the same subject matter in a WebScraping book

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety +2

      Hi, Ben, that's really awesome to hear. I haven't uploaded in a couple of weeks but it's comments like yours that motivate me to get sharing!

  • @Zancb
    @Zancb Před 3 lety +1

    Great video! I love your example use of Python code in each of those sections. Very helpful in visualizing the code being executed and the data being returned. Thank you very much for putting these together!

  • @sarcasmasaservice
    @sarcasmasaservice Před 3 lety +4

    Thanks for these tutorials, you have an excellent teaching style. I look forward to sharing your videos with my students as supplemental materials (and "scraping" them for potential assignment ideas). Keep up the great work!

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      Thanks for the positive feedback Joe, I really appreciate it! I hope your students enjoy the content!

  • @pursuing.perfection
    @pursuing.perfection Před 2 lety

    Keep doing what you are doing this is GREAT

  • @toobstr
    @toobstr Před 3 lety +1

    Just stumbled across your channel and this is some of the best content I have seen related to Python! Your teaching style is fantastic. I hope you keep making these videos. It would be cool if you explored making a video on using Selenium, scraping data, adding that data to a postgres db, making a UI that displays that db data. Oooor another thing I've been wanting to try is taking the data I scraped and adding it to an Airtable sheet for a quick and easy/shareable visualizer. Anyways, keep it up, really enjoying it!

  • @thewilltejeda
    @thewilltejeda Před 3 lety +3

    Definitely some of the best scraping tutorials I’ve found for sure !
    I’m curious if you have anything planned for crawling with scrapy

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      Thanks Will! I'm yet to get using Scrapy but I'm thinking about putting a short series of "learn with me" videos sharing how I approach learning new packages and techniques to help make new topics stick.

  • @youtubian855
    @youtubian855 Před 3 lety

    brilliant video, thanks for sharing

  • @SOFRADAKAOS
    @SOFRADAKAOS Před 2 lety

    insane tutorial thanksss! also your beard looks really good

  • @muhammadawon8164
    @muhammadawon8164 Před 3 lety

    Thank You for bringing high-quality education with super easy conceptual techniques for all levels of learners.
    Just a thing, where someone should ask questions for a specified problem regarding web scraping? Thanks

  • @olvid.o
    @olvid.o Před 3 lety

    waiting next video... thanks a lot

  • @naziherrahel8609
    @naziherrahel8609 Před 3 lety

    Thank you so much 😊

  • @lemontap7915
    @lemontap7915 Před 3 lety

    I like your beard, also your tutorials are awesome I have learned alot going through your videos. Thank you!!

  • @DenisAnzoategui
    @DenisAnzoategui Před rokem

    Beautiful

  • @user-vg4kj7mx2z
    @user-vg4kj7mx2z Před 3 lety

    Thank you dear

  • @tikendraw
    @tikendraw Před 3 lety

    You deserve more.l

  • @monicaguantay3480
    @monicaguantay3480 Před 2 lety

    Awesome!!!!

  • @alexkotov2983
    @alexkotov2983 Před 3 lety +1

    Hi!
    Your videos are great, it helps me a lot. But one thing I still can't completely understand is how to work with network page in DevTools, how to pick an element you need etc. Would be really interesting to get a little bit deeper. Watched all videos so far and still couldnt find explanation.

  • @armannurhidayat7
    @armannurhidayat7 Před 3 lety +1

    Thanks sir👍

  • @sinkingboat101
    @sinkingboat101 Před 9 měsíci

    nice!

  • @ShahzaibAnwaar
    @ShahzaibAnwaar Před 3 lety +1

    Just came across your channel and went through all the videos this week. Top notch content mate. I noticed you haven't uploaded anything new for a while. Hope all is well. Will you resume uploading new content anytime soon?

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety +1

      Yes! And thank you! Getting my 2021 upload schedule together. Stay tuned!

  • @jonnyboii1005
    @jonnyboii1005 Před 3 lety

    Hey 👋thanks for the amazing tutorial. I've got a small question. After web scraping how do you place an order on items that meet a certain criteria?

  • @creapygames5731
    @creapygames5731 Před rokem

    we need new tutorial the driver thingy was changed, but thanks alot for you content is really cool :D

  • @djordjevojimirovic6501

    Great video! Which IDE you are using in this video?

  • @renancatan
    @renancatan Před 3 lety

    Hi, very useful!
    If I have java script content to scrape, how do I keep going instead of BS4, can you past something?
    I mean, in the html = driver.page_source and after bs4.. how do I do that to keep scraping with selenium or another language as helium for JS?

  • @originalkundukulangara9281

    The part where you described calling the function login() and process_products()...Does this work in python IDE because when I use similar code in pycharm by getting all the code from jupyter notebook, it doesn't bring anything when I call login function

  • @sandeepyadav1478
    @sandeepyadav1478 Před 3 lety

    thanx for username and password. It still works ;-)

    • @socompsy
      @socompsy Před 3 lety

      Can you give some pointers on how to not include your login and password directly in your code?

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      Hi Jimmy, I would suggest using environment variables. Setting them up is a little different by operating system so you may have to google your OS.

    • @sandeepyadav1478
      @sandeepyadav1478 Před 3 lety

      @@socompsy take it from your system text file, line by line

  • @jakeleo1857
    @jakeleo1857 Před 3 lety

    Like as boos 👍

  • @elshroomness
    @elshroomness Před 2 lety

    Omg! Such an awesome video!
    Quick question. Selenium has a known issue with drag and drop function. Do you know a work around for it? I've been stuck on this isssue for two months now.

  • @ahmedelbon2755
    @ahmedelbon2755 Před 3 lety +1

    Thank you Adam. If it is possible in future uploads to link a .txt file in the description containing the code if it is possible.

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety +2

      That's a great idea, I'll make a Github for them all

  • @roberthuff3122
    @roberthuff3122 Před rokem

    Thank you! Late, but did you ever release your code as a Collab resource? Yes, I am lazy.

  • @justinleard7661
    @justinleard7661 Před 3 lety

    Great video. Spent half a day reviewing other videos of similar content and you went through it with the Kiwi accent plus straight forward approach. My challenge is after I login, my website redirects to the 'data' page. When I try to "driver.get('https:\\my.html.page') then it tells me my login is not correct. There is a remember me check box, which I have ticked in the code before trying driver.get. I suspect it is cookies but not sure on next steps. Any guidance would be appreciated mate.

  • @netbin
    @netbin Před 3 lety

    is it possible to inport brave into sillynium?

  • @snawfel1983
    @snawfel1983 Před 3 lety

    Thnks
    how would you login into an log.asp site ? I would like to scrape data behind ASP login
    plz help

  • @netbin
    @netbin Před 3 lety +1

    hey 👋 do i need to raise up my hands every time i run login function?

  • @MarioLopez-eu8tj
    @MarioLopez-eu8tj Před 3 lety +1

    I am the 2991 sub (Y).

  • @sandeepyadav1478
    @sandeepyadav1478 Před 3 lety

    Hey, i have encountered 2 more problem [not from the video code].
    1. How to take values of text changing div. (like after click it changes value)
    2. my jupyter nootbook works different in every cell, like if i wrote imports 1st cell then i have to write in 2nd cell too. so i can run code in different cells like u.
    Thanxx

    • @alenjose3903
      @alenjose3903 Před 3 lety

      thats weird, you should definitely re install anaconda or just download the jupyter again

  • @josuecrespo8386
    @josuecrespo8386 Před 3 lety

    Hey I started using python for web scraping since I saw your video. But I have reach a mental brain freeze cuz there is a epub book web that I like. And I have been trying to scrape from it with out any success. The web is VK website is you can point me in the right way I would appreciate it

  • @snackers65
    @snackers65 Před 3 lety

    When I try to run the process_product function, I place in the html like you have done, but it spits back an empty list [ ]....I have been reviewing your code and I don't seem to see where I went wrong.

    • @alenjose3903
      @alenjose3903 Před 3 lety

      if you still need help, just mail me @ alenjose59@gmail.com. I had the same problem, its a quick fix

    • @sandeepyadav1478
      @sandeepyadav1478 Před 3 lety

      AHH, bro that site code have been altered little bit. So u have to select parent class then drive through child divs 1 by 1.

    • @alenjose3903
      @alenjose3903 Před 3 lety

      @@sandeepyadav1478 have to send a request to select the list representation, I wasted hours thinking what went wrong. Will never make that mistake again 😂

    • @alenjose3903
      @alenjose3903 Před 3 lety

      sandeepyadav1478 that is 1 way to do it, i just redirected to the page the CZcamsr used by tweaking the url.

    • @alenjose3903
      @alenjose3903 Před 3 lety

      sandeepyadav1478 i did that cos , i followed his videos and tested the code at the end. When we load the site from scratch it doesnt work.

  • @travelselects272
    @travelselects272 Před 3 lety

    Adam, big fan of yours here!. I've hit a brick wall. Trying to scrap pages over an API call; first page is no problem. I can't find a pages param in the API URL call. Any work around you can suggest?

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      Thanks for the feedback! Is the API one that appears in the network tab in chrome? If so, can you navigate to the second page in the browser and see what the API call looks like?

    • @travelselects272
      @travelselects272 Před 3 lety

      ​@@MakeDataUseful Thanks Adam. I'm getting syntax error when I insert page variable like so {page} inside the search query url . I think it's my bad...let me sleep and recharge. ps! let me know if they is a way to share my code.

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      @@travelselects272 maybe double check you have f at the start of your string if you are using {}

  • @sandeepyadav1478
    @sandeepyadav1478 Před 3 lety

    I want to login into gmail, but having some trouble with specific id or class name. can u help?

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety +1

      Hi sandeepyadav1478, of course I can but first you'll need to provide a little more detail. You mentioned logging into Gmail, is there is a specific task you are looking to do once you have logged in? Also, what code/packages are you working with? Knowing these two things will help me tailor my response to your specific use case.

    • @sandeepyadav1478
      @sandeepyadav1478 Před 3 lety

      @@MakeDataUseful Ahh, i want to find all mails send to by 1 particular person. and i m using python with webmanager, bs4 and selenium same as u r using expect IDE, i m using sublimetext 3.
      but i can't login in my gmail account coz it didn't took my keys(userdata) .

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety +3

      @@sandeepyadav1478 this task might be better suited to using the Gmail API. I'll whip up a video for you 🤙

    • @sandeepyadav1478
      @sandeepyadav1478 Před 3 lety

      @@MakeDataUseful thanx man

  • @jazer1370
    @jazer1370 Před 3 lety +1

    Im logging in to a website but it blocks me whenever im trying to login I think it needs cookie but I dont know how to use it maybe a tutorial?

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      Can do, if you're using Selenium it should just work straight away. Some websites have recaptcha to try to stop automated access.

    • @jazer1370
      @jazer1370 Před 3 lety +1

      @@MakeDataUseful im trying to login on nike snkrs but the error says cant connect to the server like that. Generic Post 0 like that

    • @MakeDataUseful
      @MakeDataUseful  Před 3 lety

      @@jazer1370 I'll check it out and get back to you

    • @jazer1370
      @jazer1370 Před 3 lety

      Thank you so much 🙏

  • @rafnishad3523
    @rafnishad3523 Před 3 lety

    give us some ETL video tutorials