Extracting HTML source code in PyCharm

As you are working on your web project, you might notice a display or feature from another website that you'd also like for your own site. Typically, you would go to that web page, inspect its source code, and try to apply the appropriate portion of code to your own project.

When using PyCharm, you can have the IDE facilitate this process and fetch the HTML source code for you:

  1. Go to File | Open URL.
  2. Type in the address of the website from which you'd like to extract the HTML source code.
  3. Hit OK.
  4. A scratch HTML file will be populated with the HTML source code of the site, and opened in the editor. For example, the following screenshot is my output after fetching the source code of https://www.packtpub.com/:
Fetching HTML code in PyCharm

Again, this feature is particularly useful when you have to inspect the source code of a specific web page, either for the process of simulating the same features for your own site, or for web scraping.

We have considered a number of important features in PyCharm when it comes to writing and editing HTML and CSS code. In the next subsection, we will learn about the options available for JavaScript and how they can help us become more productive in our web projects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.103.8