From the course: Build Three Real-World Python Applications
How to explore a webpage - Python Tutorial
From the course: Build Three Real-World Python Applications
How to explore a webpage
- Do you know that you have the ability to view the HTML and JavaScript code behind every website you visit on your web browser? It's a very handy skill to know. Please note that some websites will only share some of their code to the public. In our case, we will explore all the code behind the website Wisdom Pet Medicine. In order to see the code behind a webpage you need to navigate to the developer tools. If you are on Google Chrome or Microsoft Edge, you can navigate to the top right of your screen where the three little dots are. Once you click on these three little dots it'll open the webpage menu. Once you are in the webpage menu, navigate down to the more tools option and hover your mouse over it. Now, you'll see a sub-menu appear just to the left of the More tools option. In the sub menu, navigate to the developer tools option at the bottom and click on it to show the code behind the webpage. If you are using Safari on a Mac, then you need to make sure you have the developed tab accessible. Open Safari and go to the Safari menu tab on the top left and click the preferences option. Once you have this open, navigate to the advanced section in the menu that popped up. In this Advanced section, navigate to the bottom of the menu and click show develop menu and menu bar. Once we've done this, you can exit out of this menu and we have our developed tab. To navigate to the developer tools also known as the web inspector on Mac, select the developed tab and menu. Now, that we have this open, you will want to go down to about where the middle is of the menu option and you'll want to click on the option show web inspector. Once you click on this, you'll be able to see the HTML code behind the webpage like you would in Google Chrome or Microsoft Edge. We will switch back to Google Chrome. Now that we are in the developer tools section, we can see the code behind the webpage we are on. If you do not see the HTML code, make sure you are on the element section. When you first open the HTML code it is very condensed with much of the code being hidden. You can expand the code by clicking the little triangles to the left of the code like this. Now we can see more and more of the code as we continue to expand it. It can be exciting knowing how you can easily view the code behind any webpage but it can also be overwhelming if you are not familiar with HTML code and don't understand what the code is doing. You are taking a great step by completing this course to learn more.
Contents
-
-
-
What is web scraping?2m 57s
-
Introducing the Wisdom Pet Medicine website2m 4s
-
How to explore a webpage2m 45s
-
(Locked)
Understanding HTML code1m 56s
-
(Locked)
Understanding the requests package3m 8s
-
(Locked)
How to use the get() method2m 38s
-
(Locked)
How to retrieve webpage information4m 4s
-
(Locked)
How to retrieve HTML code1m 36s
-
(Locked)
How to use BeautifulSoup2m 20s
-
(Locked)
How to use find() and find_all() methods3m 52s
-
(Locked)
How to loop find_all() methods3m 21s
-
(Locked)
How to retrieve webpage links2m 18s
-
(Locked)
How to write HTML code to a text file2m 7s
-
-
-
-