 A viewer that goes by the name 50Red510 asks, wants to know how to automate a method of retrieving specific text off a Wikipedia I'm assuming article. So let's go ahead and do that today. Let's look at an article here. Let's look at our Linux article. So let's say we want to grab a section. How about this info box right here with all the basic info about Linux. Almost every Wikipedia article has this quick overview of whatever it is the article's on. And I'm in Chrome right here. I'm going to hit F12 to bring up their little console down here and under elements. I'm going to click this little magnifying glass and hover over here until that box is highlighted. And I can see down here in the code that this is a table and it has a class of info box. I'm going to assume at this point that it's the only object on the page that's labeled info box. It may or may not be. We'll find out as we proceed. So what we're also going to look at is where that table ends which we can easily see in this view here. It is a table and the table closes with I think I went past it here. Did I even open up the tag? No, so I opened it up and we can see it closes with the closing table tags. As long as there's no table within that table, the code I'm going to show you right here works. So it really depends on what you want to get off the page. But let's just retrieve this info here, the basic text out of there. We're not going to grab the image although we could, but I'm assuming that's linking to some of this page and it's going to pull down the name of that file, but not necessarily the full length, the full link, the full URL which we could do if we want to. But keeping things simple here, let's go ahead and work on that. So let's grab the URL for the page here and let's go to our shell here and we're going to type, we're going to use WGet. You can also use curl. We just need something that can download that page, the source code of that. I'm going to do Q because we don't want to have the output although you could of the downloaded information. If something goes wrong you can turn off that Q to get a little more information. Then I'm going to say dash capital O, that's for our output. Instead of getting a file name I'm going to give it a dash which sends it to standard out. At which point we're going to pipe it into said. And I've shown in the past how to grab all the information, all the lines between two lines containing certain strings. So let's go ahead and do that and do dash N. And then inside some single quotes here we're going to say forward slash and as we said info box was the class that was in. Forward slash comma forward slash. And then we're going to want that closing table tag which is like this. But we also have to remember that since there's a forward slash in this we're going to have to use a back slash before that forward slash so that it doesn't think that it's this forward slash. Next and you also want to spell table properly. And then we're going to put a P at the end here. So this is going to search through the document and find the first line that contains info box and grab that line and every line through a line that contains the table tag and grab that table at line as well. And it will output it. So we do that and there's that code right there. A little hard to read at this point. So what I'm going to do, we could write a script and there are tools out there to remove all the HTML tags and just leave us with the plain text. But let's go ahead and leave the HTML tags and we'll have some sort of formatting in it then. So what I can do here is I can pipe it into a file. Let's go ahead and clear the screen here. Pipe it into a file I'll just call it info dot html html. So all that basically all the html from within that tag is now stored in this file and we can open it up with again a text editor and see the code. There are some text based actually let's go ahead and try this out. I wasn't planning on doing this but we'll see. There's a few different text based web browsers you can install called links. Each one's spelt a little different but all I'm going to do is I'm going to say links and I'm just going to say dump to dump the information and then I'll say info dot html and there we go that program outputs all the links but here is the text from within that box. Another thing we can do since we have it saved as an html file clear the screen again I can say open it up with whatever web browser I use so that same file that we've already saved I can open it up with google chrome and there we go again we don't have the image the image box is there but it doesn't link to it properly but here is all that information all the text information that is inside this box right here. So another thing we can do now that we have that code we should be able to apply it to most Wikipedia pages like I said most of them have a box so here's the page for Unix so again I can grab that URL and just go ahead and replace it in fact I don't even have to paste it I can just come over here and know I change Linux to Unix to get that article and we just overwrote the old file so of course if you don't want to overwrite you can always create a new file but again I'll say google chrome info.html and there we go now we have all the info from within this box again excluding the image which with a little more coding you can definitely grab as well but basically if we're just looking for the text and then you can also you know grab through that and cut it up if you just wanted something in particular. So that is how you would grab a certain section an example of how you can grab a certain section of a web page in this case a Wikipedia article using a shell script. I thank you for watching I hope that helps answer the viewer's question in a quick way and as always please visit my website that's Filmsitechrist.com Chris of the K there should be a link in the description as always have a great day.