Extracting quotes and outdoors.
Hello, everyone.
Last time we learned how to extract titles with scrap into the world, we're going to expand our skills.
So I will show you how to extract headers and specifically quotes and outwards from the website.
So we're going to go to our quote, website again.
But first, our exit, this step here.
So we're going to exit the interactive console, as you can see.
And I will write again scrapie Shell.
And it is very important to know that when you write scrapie shell, this means get the information
from the website and give me a tool to interact with the information from this website.
So whatever website you write after Scrappy Shell, you're going to assess all the information for that
website or to the court of this website so you can extract whatever you want.
So if I write HTP.
OK, and then quotes not to.
Scrap dot com.
I'm actually running here at the shell of the scrapie, as you can see, so let me write a comment.
Let's write a response that says and then I write Deiva.
Quote, OK.
And you can see that we're getting actually all the calls for the website, so you can see here that
we have data equals a class quote, and then you see items call and you can see the different quotes
that are listed in this website, which are quite useful, actually expands because of blocks of information
are sometimes quite huge.
So.
They may actually bring it a little bit up and let's try it another thing, so I will right here, our
code variable equal to a response, not Cyesis.
And then def.
Dr..
Quote, OK, let's close a bracket and then zero and hear all the response that we've got.
So the quote is going to distort in the quote files of read quote, you can actually see that this is
an expected variable because the next part is actually the foundation of corruption.
You can see that there is more information here that's assessable for us in this parameter.
Now let's extract the title, the outer and the actual, the quote.
OK, so if a right title equals quote unquote success and then if you right.
Spane, not text.
And then.
Next, hey, let's close here, then extract, underscore.
First, and let's close here.
So if I were on this, of course, nothing happens, but if I displayed a title variable, OK, you
can see the actual title, which is The World as we have created it is a process of our thinking.
It cannot be changed without changing our thinking.
OK, so this is the main quote or the title of the website, and this is how you can actually export
it.
And now let's see about Autre.
So let's see who said that.
OK, so if I right.
Outer outer equals OK and then quote.
The CIA says and here in a site, I'll write Small Dot Ilter next.
OK, let's close it and of course, to extract it, they will write extract first, so let's read,
extract, underscore first and that's it and let's hit enter.
And I misspelled Outr, but this does matter because the variable is still there.
So if I simply copy and paste this variable, OK, let me copy it.
And so I based it and you can see the name of the order.
So out or that setup was Albert Albert Einstein.
And after we have the or let's talk about the tax so you can get the tax from that quote and tax are
usually things that people that are creating the quote are adding.
These are some keywords with which the quote can be discovered.
So the tax are pretty easy to obtain, but actually also very important because if you get the right
tax for something very popular, you can actually use them in order to appear in the search engine.
So if we do tax, OK, you course cool dot cases and then if I do do tax and then a dot dot.
And then next, OK.
And then I will do dot extract.
OK, so if you're on that and then the right tax, yes, I just do the spelling mistakes with the right
tax.
You can see all the tax from this quote.
So they're of change.
Deep thoughts, thinking and world.
OK, so these are the tax that, for example, a search in the search engine.
This quote might appear in some of the results, obviously not on the first place, but it will be there.
So now, guys, since we found how to extract each element of the quotes, we can actually put them
together into a python directory.
So let's write the for loop.
So let's write for quote in response dot success.
And you can write here.
Do dot quote.
OK, and here we can start writing text equals gold dot success, and then I can do spane dot text.
And then.
Next, OK.
Let's close it, don't extract.
First, and so this is how this works, this is how you can actually extract quotes, how you can extract
tax from the quote and how can extract the actual output of a quote.
So thanks for watching, guys, and bear me in the next video where we're going to do a very similar
thing.
But now we're going to do it in my channel with the script and then we'll run it from our terminal.
Thanks very much for watching and I'll see you in the next video.