Beautiful set of software.
Hello, everyone.
Today, we're going to talk about the beautiful set package and what it means.
So I will show you quite a lot of examples so you can practice this specific package.
But let's first talk about what this package is used for.
So beautiful setup is a very easy and simplified way to search data within the HTML file.
You can use many different types of criteria's in order to do that.
And as you can see, I it in front of you, some of them.
So you can use the structure code, deal em to search into the XML file elements, you can search for
selectors and you can search through tax.
And actually, if you don't understand what these elements are later on, I will create a different
lecture's for each of these elements and you will be able to practice them.
And this is not everything about the beautiful setup.
With this two, you're actually able to investigate a lot of files just by using Python.
So obviously, since it's a python, of course, the beautiful soap is a python, too.
So this means you can search within the XML, HTML and Jason files just by using Python from the terminal
or by writing a script and implemented to get into Python file.
So let me make something clear here.
The beautiful soap does not intend weap scrapping.
It is actually a tool that is specifically for providing an interface to assist in a very simple way,
any Web page into HTML or other files.
So with this too, you're basically preparing your file for the scrapping, which happens after that.
And we're going to talk about this as well.
So the main features of the beautiful soul are to instruct information of HTML documents.
It also enables you to pass HTML, but also XML files.
And it has a very interesting feature which allows you to structure your pages or document into a tree.
And we're also going to look and this this one as well.
And finally, with the information that the Google so extracted, you can actually operate it very easily
by the advanced search links and tax into that file using the beautiful soul.
So guys, usually in order to install specific features for that from the beautiful shop, you can go
to this Web page here that you can see.
However, when dealing with Python, obviously you can simply stories from the terminal.
So for that reason, let me open a terminal.
And as you can see, I have saved the terminal from the last lecturer's, which is quite nice.
And here I'm in the folder called Section four, because now this is Section four.
So here's how we can install the beautiful soap and I will pipe.
Install beautiful soap, three or less to four.
OK, so once I do that, as you can see already here, it installed.
So it will not just on my computer, but once you do it, it will actually start historic inside your
machine.
So this is the way that you do it from the term.
No way more simple than the one warning get from the website.
So in order to start operating with the beautiful soap, let's go to Python mode.
OK, and if you remember from the last video, we added some comments in order to create and operate
with HTML file of a website.
So let's do the same thing here.
And I will just copy and paste what we already have.
So import resources, sorry, import requests my bed and then we'll get the request from this website
here that you should already have in your computer.
And then we'll again import the military to import the HTML and who are the root of the HTML.
So after you perform those comments now we can actually import the beautiful soap into our code.
So I will do from these four import beautiful soap.
OK, so here is how important this package into your Python file.
So when he took, you can see that there are no errors and we can continue.
So after that, let's create a variable and this variable, of course, will be over type beautiful
soap.
So I write beautiful soap in here and say you need to add the parameters of the website.
So as you can see here, the request that website is stored in the variable response.
So let's either break it in our right response dot content.
OK, so here's how we refer to the content of the website.
And after that, let's write commo and the document will be opened with the parser XML.
So you can see how now we use that XML in the beautiful soul.
And this is what I want for discourse, everything to gradual.
So if you don't know that it works in no, you will not be able to use the beautiful soap.
And this will continue in that way when we learn about this crap and later on.
So if I hit enter here, OK, we can see that we get an error.
So I think that was because of a spelling mistake.
So let's write a response and dot com and and here, sweetie, and this should be in parenthesis, guys.
Sorry for the quite a few errors, but I just came back from work, so my brain needs to change the
mode for making courses more anyways.
So here's how you add to the beautiful setup, for instance, of beautiful setup for the website that
we executed, which is the Debian dot org.
And here's how we created an instance of the beautiful social class.
So now in this file, in the file, we have all the information needed in order to navigate into our
document and to assess each level of the website.
So here is how, guys, you can basically set up the beautiful.
So thanks for watching.
In the next video, we'll continue with this project with the B.S. document that I showed you.
So today we learned how to obtain the document.
But today, tomorrow we're going to start from here and I will show some pretty cool features of the
beautiful social package.
So that's, I think, very much for watching.
And I'll see you in the next video.