Python Web Scraping with Beautiful Soup and Regex

  Рет қаралды 199,249

Engineer Man

Engineer Man

Күн бұрын

Check out the power of Python with a demonstration of web scraping using Beautiful Soup and also some Regex.
Hope you enjoyed the video!
Check out this code here:
github.com/engineer-man/youtu...
Join my Discord server to chat with me:
engineerman.org/discord
Check out some code on my GitHub:
github.com/ebrian/engineerman
Tweet me something funny on Twitter:
/ _engineerman
Say hi over at Facebook:
/ engineermanyt
Sincerely,
Engineer Man

Пікірлер: 277
@cetrusbr
@cetrusbr 5 жыл бұрын
I like your tutorials because u go directly to the content, something rare in youtube these days...
@kalef1234
@kalef1234 5 жыл бұрын
Hey guys what's up before we get started smash that subscribe button, like this share it i am giving away a fucking gift card follow the links to my merch watch my ads really helps thanks okay...roll that intro *45 second intro*
@sourabhch3044
@sourabhch3044 3 жыл бұрын
So true thank you for putting out the points which matters.
@mixalismcgamer3188
@mixalismcgamer3188 4 жыл бұрын
Dude i watched over 15 videos+ that was recommended and after hours i found this FULLY EXPLAINED.
@kalef1234
@kalef1234 5 жыл бұрын
I felt so powerful as soon as I pulled an array of strings from a random website. Thank you for your great tutorial
@zigginzag584
@zigginzag584 4 жыл бұрын
It helps so much to have someone that matches your personality when learning stuff. I can't stand when asking someone for instructions on how to do something and they tell me everything that I can expect and every once i a while throw in the thing I'm supposed to do next. None of the fluff here. Just context. Every other creator would/has made this subject a 45min+ video but here I am feeling proficient after just 14 minutes with EM. Thank you, Sir!
@EngineerMan
@EngineerMan 4 жыл бұрын
You're welcome buddy!
@xrefor
@xrefor 4 жыл бұрын
Love this presentation. Straight to the point with short and specific explanation. Keep it coming! :)
@impossible441
@impossible441 5 жыл бұрын
This is remarkable, very informative and down to the earth - I really love this concise format of yours which is rather contradictory to what most of ppl on yt are providing
@dallaskappel1
@dallaskappel1 5 жыл бұрын
Hey man! I watched this and applied the concepts to a weather site and made a csv of all the sunset / sunrises in 2019! Thank you! Please I love the way you explain things keep making videos sir! I have applied your teaching in a couple videos and it’s great! Learning so much!
@PS3PCDJ
@PS3PCDJ 2 ай бұрын
This is THE best beautifulsoup tutorial on the internet.
@dilshand.5127
@dilshand.5127 5 жыл бұрын
I was able to do this on another leaderboard site, appreciate your work here.
@bhumikakhiyani4230
@bhumikakhiyani4230 3 жыл бұрын
I was struggling to navigate to iterate through second span tag in multiple td tags I.e. (tr[1:]/td[0]/span[1]) I was trying it the whole day. This is the best tutorial I have seen. Thank youuuuu.
@clownboy84
@clownboy84 4 жыл бұрын
Thanks for the video. I like how you take the basics and break it down with really good and practical examples.
@yanggao4878
@yanggao4878 3 жыл бұрын
Your videos are fast-paced and straight to the point. Thanks!
@TomSilver_42
@TomSilver_42 3 жыл бұрын
Simply brilliantly explained. I have seen few of your videos and I like your style, therefore You have earned another subscriber.
@robertpearson2143
@robertpearson2143 5 жыл бұрын
Been doing something similar for a while but in a much more complicated way. Looking forward to making my life much easier. Thank you!
@Lu3ck
@Lu3ck 4 жыл бұрын
Your videos are fast but glorious! Love your content man! Thank you! Bless 🙏
@axelcano1623
@axelcano1623 5 жыл бұрын
Really nice content! You explain just enough to be clear but not too much that's perfect. Please continue to remind the type of the elements you create, it's very important for beginners.
@ViniciusProvenzano
@ViniciusProvenzano 3 жыл бұрын
Real Nice content! Straight to the point. I’ve played around with beautiful soup a few years ago for an small project, and I just wish this video was around at the time....
@stephenrochester6309
@stephenrochester6309 5 жыл бұрын
These videos are brilliant. Thanks for all your hard work.
@SusiEzhil
@SusiEzhil 5 жыл бұрын
wow.. thats the crisp explnation,,, you're the man!!
@enyoc3d
@enyoc3d 5 жыл бұрын
in a sea of youtube tutorials yours is the pearl. thanks!
@ladyViviaen
@ladyViviaen 3 жыл бұрын
was trying to scrape modarchive for my project, this is way better than writing the name and id down by hand lmao, thank you!
@PriZ0nM1ke
@PriZ0nM1ke 5 жыл бұрын
Wow these videos are awesome! Direct and concise but understandable!! Well done!
@kennethmcquade4341
@kennethmcquade4341 5 жыл бұрын
You're definitely skilled! For anyone watching these videos, don't get discouraged, this takes time. @Engineer Man , Can you talk about the experience of learning how at the beginning of your videos?
@ledosilverknight4619
@ledosilverknight4619 5 жыл бұрын
Some of the best tutors are always straight-forward: down and dirty!
@YeeYeez
@YeeYeez 5 жыл бұрын
If only I had this tutorial a few years back. Good stuff.
@worsethanjoerogan8061
@worsethanjoerogan8061 5 жыл бұрын
Dude you're helping me out immensely with computer science courses
@luis96xd
@luis96xd 3 жыл бұрын
Wow, I liked this video so much! It was very useful! 😄 You really have helped me a lot, it was well and fully explained, with real life examples Thank you so much for this tutorial! 👏👏
@susbedoo
@susbedoo 5 жыл бұрын
You are the coolest tech guy I have ever seen on KZbin
@qettyz
@qettyz 5 жыл бұрын
These were really good examples, thank you!
@chrisabreu7469
@chrisabreu7469 5 жыл бұрын
your videos are a life saver man. keep up the great content
@K2ThaYo
@K2ThaYo 5 жыл бұрын
Beautiful video man! Really valuable information here. As a sysadmin with over 10 years experience, I can state its really clean method of scraping. I was used to use bash scripts for everything but using libraries in python is sooo helpful. It would be a pain in the as in bash with awk, grep, etc. I hope to see more soon
@rustyelectron
@rustyelectron 5 жыл бұрын
This video is really a good intro to web scraping.
@johnbecker3116
@johnbecker3116 5 жыл бұрын
I spent forever teaching myself this last week and now you post this. Kill me now
@arturmangabeira9990
@arturmangabeira9990 5 жыл бұрын
EM you're awesome. i was studying web scraping and this come up. subscribed yesterday to your channel! lol
@EngineerMan
@EngineerMan 5 жыл бұрын
Nice!
@estilen69
@estilen69 5 жыл бұрын
Using CSS selectors is the way to go, gets rid of nested for loops and is more robust.
@matteomannini1205
@matteomannini1205 3 жыл бұрын
how?
@justinhamilton8647
@justinhamilton8647 2 жыл бұрын
Cheers man i used this tutorial to sort through 310000 embed links you’re so awesome
@Omar-ic3wc
@Omar-ic3wc 4 жыл бұрын
Exactly what I needed thank you very much!!
@asdfasdfasdf383
@asdfasdfasdf383 3 жыл бұрын
You go straight to the point. Obviously, you know a lot more in-depth about this topic. Anyway, I like it.
@DirtySocrates
@DirtySocrates 5 жыл бұрын
Excellent! Thank you!! Great vid!
@oromis995
@oromis995 3 жыл бұрын
This content is absolute gold.
@DevastaingDj
@DevastaingDj 5 жыл бұрын
Awesome! Kudos! Very helpful. Thanks man!
@royslapped4463
@royslapped4463 2 жыл бұрын
this is perfect for what I needed thank you!
@stefandevos1520
@stefandevos1520 5 жыл бұрын
love your tutorials man
@kurdmajid4874
@kurdmajid4874 3 жыл бұрын
he makes it so quick and simple
@andriybortnik8310
@andriybortnik8310 5 жыл бұрын
This is an awesome video, I actually enjoy the in depth walk through of what your reasoning behind writing code is, step by step. Versus just saying " I did this" and not really explaining anything. On a separate note , I'm looking to get into python, and I have previous code development experience, but It's been a little while, and setting up an environment to start doing some coding is a bit daunting. I'm looking to do more on the machine learning , neural networks side of things. I don't struggle with any of the logic, mathematics, but I know there are many pros/cons of various IDE's . Some have better support for various packages , etc.. I was wondering if you could either make a video on some of this information, or maybe throw a few pointers my way. I would really appreciate that. Otherwise, keep up the great content!!!
@KingEbolt
@KingEbolt 5 жыл бұрын
Let me throw some pointers at you. 0x3A738216 0x6B321970 0x88AC172B
@EluviumMC
@EluviumMC 5 жыл бұрын
I've found that I really like using Microsoft's VS Code (not to be confused with Visual Studio). The IDE has a good clean interface, lots of extension support, and a built-in terminal.
@andriybortnik8310
@andriybortnik8310 5 жыл бұрын
@@KingEbolt I can't even get mad at that... Well done
@camaulay
@camaulay 5 жыл бұрын
@@EluviumMC +1 VS Code, switched from Sublime
@BrettKromkamp
@BrettKromkamp 5 жыл бұрын
Excellent tutorial. Thanks.
@sgttye
@sgttye 5 жыл бұрын
Keep up the good work man!
@luis96xd
@luis96xd 5 жыл бұрын
This is excellent! Well explained! :D
@EluviumMC
@EluviumMC 5 жыл бұрын
Happy that you've chosen this topic. I've been exploring web scraping and have a script that works pretty well on a site that I frequent. Another awesome tool that can be used to also automate web navigation is the selenium package. But on more of a question-related note, I know the script you just made was pretty simple, and the one I have isn't that complicated, but I've been wondering how one would go about writing an object-oriented script for scraping?
@UchihaAditya
@UchihaAditya 5 жыл бұрын
What are the advantages of selenium over Beautiful Soup?? I have a web-scraping assignment now and was advised to use selenium.
@EluviumMC
@EluviumMC 5 жыл бұрын
Selenium can be used as a web scraper, but I use it more for web navigation and then use beautiful soup to actually get the data I need from the pages once they've been navigated to. I just find beautiful soup to be a more intuitive for extracting the data.
@yixunnnn
@yixunnnn 5 жыл бұрын
With selenium it is like an automated user, and when you use it, you require a web driver, and you can choose if you want the automated browser to run in the background or not. I recently used selenium because I was trying to request for content behind a microsoft login page, which is loaded using javascript, thus I needed to wait till the content was actually loaded finish before i submit anything. Unlike requests, which instantly retrieves the page content.
@treybailey6752
@treybailey6752 5 жыл бұрын
Great vid with fantastic content. Would love to see this where you first login in order to get content. Getting the headers set is a challenge.
@EluviumMC
@EluviumMC 5 жыл бұрын
Using Selenium to do the site navigation to get you logged in is how I worked around getting into a site that requires login credentials prior to scraping.
@kristiyangerasimov6708
@kristiyangerasimov6708 3 жыл бұрын
Great video. Stuff like that makes me want to program and develop software until i die.
@kylemichaelreaves
@kylemichaelreaves 3 жыл бұрын
Super helpful, thank you.
@daltonkraklan2257
@daltonkraklan2257 Жыл бұрын
This was so freaking helpful
@blevenzon
@blevenzon 5 жыл бұрын
Wow just found your channel by accident and I’m loving it. Awesome content!! Do you think you can do a vid on Elastic Stack?
@jeuxdeau2009
@jeuxdeau2009 5 жыл бұрын
I love your page man.
@xppaicyber3823
@xppaicyber3823 4 жыл бұрын
Great content
@poidog22
@poidog22 5 жыл бұрын
great stuff, thank you for this.
@grantfaith
@grantfaith 3 жыл бұрын
ty, saved me an hour of time from all these other videos. holy shit
@bennieliu3261
@bennieliu3261 5 жыл бұрын
Awesome tutorial man! Can I suggest scraping dynamic pages as the next tutorial. Would be a sweet follow up
@EngineerMan
@EngineerMan 5 жыл бұрын
Thanks. Part 2 of this is being requested a lot, I need to see what is best to do.
@xwinglover
@xwinglover 3 жыл бұрын
Great video. Great channel
@socksincrocks4421
@socksincrocks4421 4 жыл бұрын
Thank you for your video. Awesomesauce
@JeroenTrappers
@JeroenTrappers 5 жыл бұрын
Good video. Personally, i like using node with dom module and write css queries to extract what i want.
@zigabrus
@zigabrus 3 жыл бұрын
Top explanation, tnx!
@daru3450
@daru3450 5 жыл бұрын
Love your content!
@laurentthiol
@laurentthiol 5 жыл бұрын
Whaou! Amazing!!! many thanks
@ddmin3082
@ddmin3082 5 жыл бұрын
Awesome video! Can you do one on the requests module please?
@legioner304
@legioner304 5 жыл бұрын
3 searches in the loop - very dirty ) "The speed of software halves every 18 months"
@KhalilYasser
@KhalilYasser 3 жыл бұрын
Amazing. Thanks a lot.
@mhalton
@mhalton 2 жыл бұрын
13:52 Happiest man!
@EngineerMan
@EngineerMan 2 жыл бұрын
Oh god I'm not gonna be able to unhear that any time soon.
@johanneszwilling
@johanneszwilling 5 жыл бұрын
😎👍🏼 Thank you, Sir!
@LarsHolmVV46
@LarsHolmVV46 4 жыл бұрын
That was beautiful not to say absolutely excellent. Man ,,,,,
@ChrisAthanas
@ChrisAthanas 3 жыл бұрын
Thank you for a very clear
@user-jw5qm7zp9x
@user-jw5qm7zp9x 5 жыл бұрын
so practical tutorial.. I love how you teach people
@Viruhemanth
@Viruhemanth 5 жыл бұрын
carefully he's a hero
@DrSarge37
@DrSarge37 5 жыл бұрын
It would be cool to see how to deal with pagination. So you want data from /page=1, /page=2 etc. Etc.
@joefagan9335
@joefagan9335 4 жыл бұрын
In your browser go to next page and copy the url of, say, page 2 and go to last to find the last page url. Use that as a template to build the url of each page you want. Loop over them in turn.
@joefagan9335
@joefagan9335 4 жыл бұрын
John Keymer nope you’re not parsing the page a second time to find the next button. You scrape the current page and then grab the neat page by creating the string for the next url and accessing the next page - just one grab per page.
@mohamedmusleh8720
@mohamedmusleh8720 5 жыл бұрын
keep up the hard work :)
@KeithBalante
@KeithBalante 5 жыл бұрын
Love this vid
@jokerhacker7863
@jokerhacker7863 5 жыл бұрын
you are the best so i subscribed your chanel
@mirusvet
@mirusvet 5 жыл бұрын
Thank you thank you!
@magicyvan
@magicyvan 2 жыл бұрын
loved it ! Efficiency and very clear for a beginner. Would be great to have the login part, and why not sending the extraction into a csv file ;) I subscribe ;)
@supalistmain4882
@supalistmain4882 5 жыл бұрын
@Engineer Man , what is your day job? And how did you get into coding? Do you have a CS degree? and.... well instead of more questions, rather just ask whats your background (ito what lead to you adding so much value with these vids)?
@trithuckhoahoc
@trithuckhoahoc 5 жыл бұрын
thanks man
@mixalismcgamer3188
@mixalismcgamer3188 4 жыл бұрын
best videoooooooooooooooooooooooooooooo
@laxlyfters8695
@laxlyfters8695 5 жыл бұрын
Went through a 30 second hillshire farms ad. Great match youtube
@EngineerMan
@EngineerMan 5 жыл бұрын
Google knows you're into web scraping and sliced turkey lol.
@laxlyfters8695
@laxlyfters8695 5 жыл бұрын
Engineer Man no lie came back and got an ad for $3 jack box munchie meals. KZbin thinks your fans are stone while watching your videos
@bakyayita
@bakyayita 5 жыл бұрын
Thank you..!!
@chowfatt38
@chowfatt38 5 жыл бұрын
Great video again. I've been playing web scraping a while and I find that most of websites nowadays using javascript rendering quite heavy. Will you make a part 2 for talking about how to web scrape javascript rendering website? And what do you think about another web scraping package, Scrapy? thanks Man
@poidog22
@poidog22 5 жыл бұрын
This would be a great follow on. +1
@cruzab3153
@cruzab3153 5 жыл бұрын
Selenium is good and easy....
@trailrider6844
@trailrider6844 5 жыл бұрын
+2
@tayfun6378
@tayfun6378 4 жыл бұрын
puppeteer does a good job these days I think
@Megaloplex
@Megaloplex 3 жыл бұрын
+100
@JoseGarciam4t0n
@JoseGarciam4t0n 5 жыл бұрын
Hey, I really love your videos man! How about elements within elements, so for example `this link is in a paragraph`. How would you approach that?
@NokiaN8Guides
@NokiaN8Guides 5 жыл бұрын
thank you so much for this amazing tutorial, i would like to ask what do we do if the site i want to scrap require to be logged in btw this got recap
@joefagan9335
@joefagan9335 4 жыл бұрын
Usually, you can login first. Leave it open in your browser and scrape away.
@siloenoah
@siloenoah 5 жыл бұрын
Teach me your ways
@EnglishRain
@EnglishRain 4 жыл бұрын
I love you man
@MrFrondoso
@MrFrondoso 2 жыл бұрын
Génial. Dieu sait que je galère à utiliser BSoup . Et là j'ai l'impression d'avoir enfin compris.
@tobiashelbing1233
@tobiashelbing1233 5 жыл бұрын
Awesome
@DrChrisCopeland
@DrChrisCopeland 5 жыл бұрын
how would you modify this for nested div elements in place of table row and cell elements?
@kingseekerbackup3085
@kingseekerbackup3085 3 жыл бұрын
I use requests and bs4. Never thought of using regex besides pattern searching
@donaldandmijung
@donaldandmijung 2 жыл бұрын
great tutorials! do you have a tutorial on scraping with a function( ) using beautiful soup
@alfredleppanen6796
@alfredleppanen6796 3 жыл бұрын
Hey great video! Lets say in your last leaderboard example, I would like to get notified when the leaderboard has changed, so to say when something changed on the site. I have built a script where I can see the HASH change, but I cant output what actually changed on to website, do you have any tips to how to monitor what actually changed on the website?
@SiegeX1
@SiegeX1 5 жыл бұрын
Can you go over an example that first requires you to login and then requires you to use a query string with a hash token that changes after every login?
@dralexhunter
@dralexhunter 5 жыл бұрын
Can you do a video showing the interactions between sessions and bs4?
@Ashesoftheliving
@Ashesoftheliving 5 жыл бұрын
Hey E-man Great video! I wanted to ask you this. You said that "you have to know the structure of html before doing scraping from websites" which is true but I need to create a process where I can search a keyword or basically a word on multiple websites and get the content out of those websites. Now from this content, I will create a sentiment value and generate a newsfeed in my application with a sentiment value in it. Can you suggest a way I can do that? Thanks in Advance
@nicememe999
@nicememe999 5 жыл бұрын
Yes! A great tutorial on web scraping! Now I got some ideas on some websites I could scrape for data... What kind of real-world applications could this be used for? With websites providing APIs with the data nicely packaged in JSON format, it seems like getting data via APIs seems to be the better (or at least the most common way) to do this. Are there any situations where web scraping would be better?
@impossible441
@impossible441 5 жыл бұрын
I guess that any kind of scientific literature databeses use webscraping (i.e. google scholar)
@EluviumMC
@EluviumMC 5 жыл бұрын
Webscraping should be a last resort. Getting data via an API is much better.
8 super heroic Linux commands that you probably aren't using
8:38
Engineer Man
Рет қаралды 726 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 32 МЛН
How To Scrape (almost) ANY Website with Python
13:45
John Watson Rooney
Рет қаралды 37 М.
Engineer Breaks Down Hollywood Programming Scenes
11:02
Engineer Man
Рет қаралды 22 М.
Regex - Python Web Scraping for Beginners
19:35
Raw Coding
Рет қаралды 1,4 М.
Scrapy for Beginners - A Complete How To Example Web Scraping Project
23:22
John Watson Rooney
Рет қаралды 261 М.
Using My Python Skills To Punish Credit Card Scammers
7:13
Engineer Man
Рет қаралды 4,8 МЛН
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 384 М.
Python Tutorial: Web Scraping with BeautifulSoup and Requests
45:48
Corey Schafer
Рет қаралды 1,1 МЛН
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,6 МЛН
Спутниковый телефон #обзор #товары
0:35
Product show
Рет қаралды 2 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
В России ускорили интернет в 1000 раз
0:18
Короче, новости
Рет қаралды 1,6 МЛН