Intro To Web Scraping With Node.js & Cheerio

  Рет қаралды 192,322

Traversy Media

Traversy Media

Күн бұрын

In this video we will take a look at the Node.js library, Cheerio which is a jQuery like tool for the server used in web scraping. This is similar to the python video that I did on web scraping
Sponsor:
DevMountain Bootcamp - goo.gl/6q0dEa
Code For This Project:
gist.github.co...
💖 Become a Patron: Show support & get perks!
/ traversymedia
Website & Udemy Courses
www.traversymed...
Follow Traversy Media:
/ traversymedia
/ traversymedia

Пікірлер: 290
@IsaacAsante17
@IsaacAsante17 6 жыл бұрын
Brad, you always post videos that we need. This tutorial was brilliant.
@TraversyMedia
@TraversyMedia 6 жыл бұрын
For people asking what web scraping is used for, these may be helpful www.quora.com/What-are-examples-of-how-real-businesses-use-web-scraping-Are-there-any-types-of-businesses-which-use-this-more-than-others www.quora.com/Why-is-web-scraping-still-important-in-2017-What-are-some-popular-use-cases And please understand guys, when I do a video, it is just me showing you how to do something, it is up to you if you find it useful or not. I am here to help people learn not tell them what to do. Please understand that. I want to cover all areas of web development/coding, this happens to be one. People seem to think when I do a video I am saying you need to do this, no it is just a resource for people that are interested or just a fun little project
@ridl27
@ridl27 5 жыл бұрын
Nice, Brad! Very Useful tutorial for me! It took me ~1,5 hours to write the program my dad needed in his job and it will save a lot of time for him. Thank you!
@savannahniemeyer
@savannahniemeyer 6 жыл бұрын
Thank you, Brad. I can't ever follow my coding bootcamp instructor in class, so I come to your videos after and everything begins to make sense. Lifesaver!
@DerJP
@DerJP 6 жыл бұрын
This is so helpful. Gonna create a tool which scrapes a forum where I am active in. Every time a new post is created, I will make it send me an notification. The forum doesn't have this feature, so I will always be the first one to respond. :D
@Toochilledtocare-_-
@Toochilledtocare-_- 6 жыл бұрын
DerJP great project idea
@DerJP
@DerJP 6 жыл бұрын
@@Toochilledtocare-_- thank you :)
@Rohsn1
@Rohsn1 6 жыл бұрын
Brad your videos must be some king of God's gift for me. For a personal project, today I was searching frantically for one on Scrapping with Cheerio and Node.. and here I have from you.. Thanks a million..
@indiajackson5959
@indiajackson5959 3 жыл бұрын
Best video I'v seen thus far! You have no idea how essential this was to my phd. I will be acknowledging you in my dissertation.
@itzyuzuruclips
@itzyuzuruclips 3 жыл бұрын
This tutorial pretty legit. I tried learning cheerio a lot for few months but couldn't really understand much no matter what. Then came across this tutorial like few days ago and it made it look so easy :D
@alexz9499
@alexz9499 3 жыл бұрын
You spent a lot of time on one single node package and didn't understand much after months? Maybe look for something else rather than programming. Sorry, but it's true.
@itzyuzuruclips
@itzyuzuruclips 3 жыл бұрын
​@@alexz9499 Thx for the advice, tho imma kindly decline it :) Tru, I'm not a full stack developer or of any sort but I've learned a lot in these last 2 years, stuff which I wouldn't have without programming. It's something I love to do and will continue on doing cuz it has become a part of my passion
@porter2k7
@porter2k7 6 жыл бұрын
Wish for you every happiness Brad. You help people SOOO much dude and I just wanted to express my huge thanks & unending appreciation. Waves & Smiles from Scotland :)
@albinoporchagezzee4902
@albinoporchagezzee4902 4 жыл бұрын
I was actually struggling for hours with page scraping. Thank you very much.
@jeankule5925
@jeankule5925 5 жыл бұрын
Thank you dude i've been looking for that thing for hours and i've finally got what i needed,you're a life saver !
@Liquiddeath100
@Liquiddeath100 6 жыл бұрын
I literally just sat down to do this using node and cheerio. Awesome timing. Thanks for the video.
@michaelolukaka
@michaelolukaka 4 жыл бұрын
still learning a lot from you...you are ever my first choice of a tutorial when I search for help...thanks man
@jagadeeshmanoharan9613
@jagadeeshmanoharan9613 6 жыл бұрын
Just now completed your react front to back course. And the next one is here. Boosting up💪
@TraversyMedia
@TraversyMedia 6 жыл бұрын
Awesome!
@jagadeeshmanoharan9613
@jagadeeshmanoharan9613 6 жыл бұрын
Keep going Brad. You are the inspiration for web developers like me.
@mayankk2800
@mayankk2800 6 жыл бұрын
How is the course??
@jagadeeshmanoharan9613
@jagadeeshmanoharan9613 6 жыл бұрын
mayank k undoubtedly the best efforts from Brad .
@KochharAmandeep
@KochharAmandeep 6 жыл бұрын
Learning React Front to Back ❤️
@bobdpa
@bobdpa 3 жыл бұрын
Yet another save by Brad. I would've had to pay someone to pull this off. Thank you!
@codenx2
@codenx2 4 жыл бұрын
You have been always to the point. My whole internet search ends here
@WikkiOnIlluminati
@WikkiOnIlluminati 6 жыл бұрын
I was about to do some scraping. Normally I do in PHP. But this time i was thinking to do in Node and MongoDB. Brad thank you so much for this perfect tut.
@jcs7757
@jcs7757 4 жыл бұрын
dude, you explained it very well, it was THE best explaining about web scraping i found on youtube. i could keep up and understand though im a starter programmer, but its not yet what i seek. i'm looking for an introduction tutorial on the basics of these methods and parameters. an explanation about what every instance of the code will do. i don't even know if that is possible.
@munapadhi8723
@munapadhi8723 6 жыл бұрын
Traverse media is a one of best new learning
@TheChowdhouryS
@TheChowdhouryS 5 жыл бұрын
Traves I love your YouTub and Udemy lessons, please continue creating detail videos for a new developer like me.
@kamalhm-dev
@kamalhm-dev 6 жыл бұрын
Thanks for all the help you provide, Brad, hope you live long and prosper!
@neithanm
@neithanm 6 жыл бұрын
A tiny suggestion: instead of reading '(i, el)' like "index and el", you should say "index and element". Everybody can read "el" but not everyone may know that it's an element and cause confusion.
@Tidaltwist
@Tidaltwist 6 жыл бұрын
I think It's obvious that the .each function takes in the index and element arguments. People who don't know may quickly google it.
@theblinkstykrab3106
@theblinkstykrab3106 5 жыл бұрын
@@Tidaltwist I think it's obvious that the ".each" function is actually called ".forEach". People who don't know this would quickly realize after trying to google search for it
@honglytech
@honglytech 4 жыл бұрын
Who thinks el = else? :D
@linyerin
@linyerin 2 жыл бұрын
@@honglytech To me 'ele' is more obvious as 'element'
@GeekMustHave
@GeekMustHave 6 жыл бұрын
Brad does vacation, I'd more like to believe in time travel. Happy Trails, Keep broadcasting!!
@omiros210
@omiros210 3 жыл бұрын
Excellent description of Web Scraping! Keep up the good job!
@reidyoung298
@reidyoung298 6 жыл бұрын
12:36 "Now notice there's a shit load of white space there..." Brad, you're awesome, man. Love your videos. Thanks for keeping it fresh and consistent. You help to keep my curiosity flowing, that's for sure. Any chance you can hop into some buzzword spaces like blockchain, AI, NLP, etc.? That would be sick to check out if it makes sense for your audience.
@transforms-tools
@transforms-tools 6 жыл бұрын
I was always curious about Web Scraping and you made really easy for me to understand. Thanks alot
@YaserAz
@YaserAz 6 жыл бұрын
Thank you Brad. Have a nice vacation my friend, all greetings to your family .
@MarkZuckerberg69691
@MarkZuckerberg69691 6 жыл бұрын
getting scary now, everytime I struggle with some javascript problem, you make a video about it within the same day. thanks, gonna scrape the shit out of those websites now
@TraversyMedia
@TraversyMedia 6 жыл бұрын
Mark, I would think you would know how to scrape a site, with you know , building the worlds biggest application and all :)
@MarkZuckerberg69691
@MarkZuckerberg69691 6 жыл бұрын
Traversy Media haha you humans dont know about time travel yet, funny. I aquired information from your channel and made myself rich 15 years ago
@MuffinologyTrainer
@MuffinologyTrainer 6 жыл бұрын
Real nice, looking forward to more 'ethical' courses like this one, I needed web scraping for so many workarounds. Even if its considered "bad" because you could easily scrape off and use data from public websites, it's still a tool available for the public and makes lots of tasks way easier, if you find the right use for it.
@greddee
@greddee 6 жыл бұрын
Mad Trippin I agree and I think that webscraping is okay, as long as you do it like once a day/week or whatever and keeping it at a minimum.
@AceixSmart
@AceixSmart 6 жыл бұрын
@4:44 "const money sign"😂😂😂
@ResonanceMusic2011
@ResonanceMusic2011 6 жыл бұрын
Awesome tutorial, Brad. Super happy to do some js scraping!
@chamodnimsara7054
@chamodnimsara7054 6 жыл бұрын
u da man Brad ....I just wanted this video from u and there it is thanks a lot man
@Eshcole
@Eshcole 6 жыл бұрын
This was fun, simple, and awesome. Thanks Brad!
@MULTICODE
@MULTICODE 6 жыл бұрын
Thanks for this upload, you are helping a lot. And I appreciate it. 😍 traversy media is my web dev reference favorite
@KingstonFortune
@KingstonFortune 3 жыл бұрын
very well explained, you're the best
@williamwilson9866
@williamwilson9866 5 жыл бұрын
Good introduction to cheerio. On csv files, if you surround the date value with double quotes on the write statement, you could avoid replacing the comma.
@sray118
@sray118 6 жыл бұрын
Thank you so much traversy media, this solves my question
@erkb9398
@erkb9398 6 жыл бұрын
This was very usefull and exactly the level I've needed to get started.
@gtisonumehta5371
@gtisonumehta5371 4 жыл бұрын
I love your all videos and also your voice 😊
@feranst9111
@feranst9111 6 жыл бұрын
This is actually very cool and helpful!
@macmacmac740
@macmacmac740 5 жыл бұрын
quick and easy to understand. Thanks.
@siddhantkumar7036
@siddhantkumar7036 6 жыл бұрын
Enjoy your vacations and wouod love to see your photo with your family
@nagahumanbeingzooofparticl8836
@nagahumanbeingzooofparticl8836 6 жыл бұрын
Web Scraping with node.js.. Yes! Thank Brad
@harmit5445
@harmit5445 6 жыл бұрын
enjoy your vacation my code guru
@guyma15
@guyma15 6 жыл бұрын
Amazing tutorial Brad. I was planning on making a website that requires NFL data. This is extremely helpful
@ajitsakri9888
@ajitsakri9888 4 жыл бұрын
i think it is dynamic but you need to host it somewhere(i guess)
@Huy-ed2re
@Huy-ed2re 6 жыл бұрын
I love this tutorial! Thank you, Brad!
@chrismorris5241
@chrismorris5241 6 жыл бұрын
Best tut I have found thanks!
@andreiconstantinescu9830
@andreiconstantinescu9830 6 жыл бұрын
Hi! Not here to pick on stuff, just curious about why did you choose a library powered by jQuery? I personally have not invested time in learning jQuery and I believe now (2018) it is still used, but for legacy stuff, mainly. Thanks for all the work and dedication, support and all the great content you put out there for us Brad, Happy Holidays! Andrei
@TheUKFishingGuy
@TheUKFishingGuy 5 жыл бұрын
Thats a well interesting video... thanks for putting in the effort to make a video and sharing
@ldhpro
@ldhpro 6 жыл бұрын
thank you Sir.. It is good to see you do your best. so good.
@Mishka2Boom
@Mishka2Boom 3 жыл бұрын
Thank you mate! Super useful!
@Quniverse
@Quniverse 4 жыл бұрын
God bless you and your channel
@paolodrago9254
@paolodrago9254 4 жыл бұрын
Love these vids, you're the best my guy!!!!
@sukanyasinha3583
@sukanyasinha3583 3 жыл бұрын
Sir, your videos are awesome... please upload some more videos on cheerio
@darshankhandelwal7290
@darshankhandelwal7290 3 жыл бұрын
you saved my day man
@juanpaul6141
@juanpaul6141 6 жыл бұрын
Lovely tut. Enjoy vacations.
@MegasXLR
@MegasXLR 2 жыл бұрын
Great tutorial, thanks :)
@ojo-femioma-victor9912
@ojo-femioma-victor9912 6 жыл бұрын
Traversy Media is the best
6 жыл бұрын
Congratulations for this awesome video!
@jakep7980
@jakep7980 4 жыл бұрын
This was very helpful, I was stuck with my personal project but I was able to learn and adopt the concept into my own code thanks!
@DigitalMonsters
@DigitalMonsters 4 жыл бұрын
How do you scrape a site that just has crazy amounts of nesting, duplicate elements, slightly different page structures between items, little to no ID's or class names? Basically really messy poorly / variably structured data?
@siteyekad6683
@siteyekad6683 3 жыл бұрын
that was awsome man thank's very very much
@HK-sw3vi
@HK-sw3vi 4 жыл бұрын
I took a sip of water everytime he said "it's simple jquery stuff". update: I'm at the hospital being treated for water intoxication.
@sadafarafat4887
@sadafarafat4887 6 жыл бұрын
thank you sir for teaching us 😇😇
@ego_sum_liberi
@ego_sum_liberi 6 жыл бұрын
It’ll come in handy. thanks.
@vaggelismanousakis6147
@vaggelismanousakis6147 2 жыл бұрын
What happens if it returns null no matter what # (id) or .(class) you add to line 8 ? Can a website block Cheerio ?
@craigdavies6937
@craigdavies6937 6 жыл бұрын
Another great tutorial. 😎
@uyufokokim
@uyufokokim 6 жыл бұрын
Wow, thanks so much for your help!!!
@ayushdixit3183
@ayushdixit3183 6 жыл бұрын
nice specs. brad....lov ur videos
@onecarwood
@onecarwood 6 жыл бұрын
Aim eating Cheerios right now. I think it’s helping!
@TraversyMedia
@TraversyMedia 6 жыл бұрын
HAHA!
@nikitakrulikov
@nikitakrulikov 5 жыл бұрын
Very Great and very awesome. Your video is really helpful for me. Thank you. I hope you'll make good video in the future. Thanks again. Best Regards. Lyov Orlov.:)
@henriqueuller6865
@henriqueuller6865 5 жыл бұрын
It's amazing! Thanks a lot!
@AbhishekKumar-mq1tt
@AbhishekKumar-mq1tt 6 жыл бұрын
Thank you for this awesome video
@pietrodellanotte
@pietrodellanotte 6 жыл бұрын
All right Mr. Brad!
@sheikhrashed1242
@sheikhrashed1242 4 жыл бұрын
I love you brad 😀
@sveinsoermo9883
@sveinsoermo9883 6 жыл бұрын
BTW Brad...pls on offending, BUT U need more sun bro! ENJOY U'r vacation, I cannot enjoy anything without working! Thx a lot for fantastic stuff on U'r channel!
@TraversyMedia
@TraversyMedia 6 жыл бұрын
haha, I have gotten plenty the past few days :)
@ИльнарКамалетдинов-м7ю
@ИльнарКамалетдинов-м7ю 6 жыл бұрын
When you recording video, you speak simple, and i understand alost everything what u said :D
@ranzorethor5295
@ranzorethor5295 5 жыл бұрын
instead of using regex to replace the whitespace, could you also use jqueries .trim() as well to do the same thing? Or would that also remove the spacing between the words of the post as well?
@luissebastianarribasplatac8195
@luissebastianarribasplatac8195 4 жыл бұрын
This is awesome! There's anyway to return a json file instead of a csv file?
@mohammedserwan9844
@mohammedserwan9844 6 жыл бұрын
Hope You Happy Vacation😀
@TraversyMedia
@TraversyMedia 6 жыл бұрын
MOHAMMED Serwan thanks 😊
@mohammedserwan9844
@mohammedserwan9844 6 жыл бұрын
Traversy Media Am Glad That You Have Answered Me Twice😁❤️
@martijnkorbee1635
@martijnkorbee1635 6 жыл бұрын
Thanks for your video! :)
@josegomera9066
@josegomera9066 6 жыл бұрын
Great tutorial, thanks
@asdfasdfuhf
@asdfasdfuhf 6 жыл бұрын
More nodejs videos! Keep it up!
@cfsolutionsforfree
@cfsolutionsforfree 4 жыл бұрын
Bro will This work dynamically? I mean if I change source websites contents, will it automatically change the csv?
@ajitsakri9888
@ajitsakri9888 4 жыл бұрын
yes it is dynamic but we need to find a way to host it(i guess)
@DuneKraftwerk
@DuneKraftwerk 6 жыл бұрын
Hi Brad, I know this is not related to this video and it is not the first time this question has been asked but, may I know how you made your KZbin logo and intro ? Everything looks so professional. cheers.
@simplyfabian
@simplyfabian 6 жыл бұрын
Really great video on this for beginners, I've also did an introduction on Web Scraping with Puppeteer for handling cases where the pages that you want to scrape need to be dynamically rendered 💻
@yschin5663
@yschin5663 6 жыл бұрын
Thanks Brad, this is what exactly I looking for!
@salargentieri4540
@salargentieri4540 6 жыл бұрын
Brother Brad! Dope video! I was hoping you could throw me the npmjs info on request cause I can seem to isolate which one you are using. Also how do you feel about axios vs request?
@NotLudovico
@NotLudovico 6 жыл бұрын
Hi Brad, wonderful video. Have you got any book of web graphics to raccomande?
@harrisfpv
@harrisfpv 6 жыл бұрын
very good video! what would you do if the page you want to scrape renders using react or any other javascript framework? because it only shows you the html part before it gets rendered
@atikfahad
@atikfahad 6 жыл бұрын
you are crazy man! ♥
@elliottharris4526
@elliottharris4526 5 жыл бұрын
Setting up the environment e.g. installing node.js and having VS studio properly configured to follow your steps is admittedly probably beyond the scope of this tutorial, as well as you admitting you are in a rush but it would have been really helpful for a beginner like me. Any chance you would do a follow-up (or have already done) covering this?
@ufotofu9
@ufotofu9 5 жыл бұрын
Yes , I am almost postie that Travers has videos look like that. You shooed search for tutorials on node js, JavaScript, npm and dependencies.
@elliottharris4526
@elliottharris4526 5 жыл бұрын
@@ufotofu9 Thanks. I will have a look.
@bioJockey1
@bioJockey1 6 жыл бұрын
Isnt casting every element with $(el) Inefficient? I guess for a program this small it doesnt matter but if i want to scrape lots of pages (as in close to a million) do you think it wouldnt matter still?
@MaxOnMaxxer90
@MaxOnMaxxer90 4 жыл бұрын
Is it possible to just use this code on the client side, when a user clicks on a button? Because it says that Cheerio is specifically for the server.. Thanks for the great video, thumbs up!
@akram42
@akram42 4 жыл бұрын
pefect tutorial , cheerio is better than beautifulSoup when scrapping, I'm trying to do pagination with cheerio. thanks
@abhijeetraj7952
@abhijeetraj7952 6 жыл бұрын
great lecture! by the way you can just use .trim() to extra spaces.
@SiviweXakaza
@SiviweXakaza 5 жыл бұрын
Can you create an express server that returns a json object of the scrapped data?
@jonathanclark6489
@jonathanclark6489 6 жыл бұрын
you are such a G!!!!!!
@dcab7290
@dcab7290 5 жыл бұрын
Hi, I tried your code but neither it outputs the data on console nor in the file. The line after the "each" statement that is console.log("scraping done..") executes. Please help
@djBulba
@djBulba 6 жыл бұрын
Layman question, for sites that need login (or maintain sessions) can we run this kind of code?
@Mr.Sanguine
@Mr.Sanguine 6 жыл бұрын
Yu can combine selenium with this to do what you need
@StaySickGdl
@StaySickGdl 6 жыл бұрын
I've been looking into this also without any luck, my company websites ask for a certificate PIN I've tried with python and selenium but cannot make it work to send the keys, for people like me who does not have access to AD API or to an application API is almost impossible to make things work because of all the security and password requirements you get
Intro To Web Scraping With Python
25:48
Traversy Media
Рет қаралды 201 М.
Intro To Service Workers & Caching
35:26
Traversy Media
Рет қаралды 240 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Industrial-scale Web Scraping with AI & Proxy Networks
6:17
Beyond Fireship
Рет қаралды 795 М.
Web Scraping with Puppeteer, NodeJS & Shopify
27:54
optikalefx
Рет қаралды 67 М.
Express JS Crash Course
1:14:01
Traversy Media
Рет қаралды 973 М.
Always Check for the Hidden API when Web Scraping
11:50
John Watson Rooney
Рет қаралды 664 М.
HTTP Crash Course & Exploration
38:30
Traversy Media
Рет қаралды 1,1 МЛН
A Guide to Web Scraping with Node.js
9:54
Fireship
Рет қаралды 388 М.
Node.js Web Scraping (Step-By-Step Tutorial)
12:52
Oxylabs
Рет қаралды 35 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН