{"id":5975,"date":"2023-10-18T14:47:43","date_gmt":"2023-10-18T14:47:43","guid":{"rendered":"https:\/\/royadata.io\/blog\/?p=5975"},"modified":"2023-10-18T14:47:43","modified_gmt":"2023-10-18T14:47:43","slug":"how-to-use-beautifulsoup-for-python-scraping","status":"publish","type":"post","link":"http:\/\/royadata.io\/blog\/how-to-use-beautifulsoup-for-python-scraping\/","title":{"rendered":"How to Use Beautifulsoup for Python Scraping Webpages [Tutorial]"},"content":{"rendered":"<blockquote>\n<p>Are you new to Beautifulsoup? Then read the article below to learn how to use it for extracting data from web pages. we provide an up to date step by step guide to make it easier for you.<\/p>\n<\/blockquote>\n<p><picture class=\"aligncenter size-full wp-image-21442 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-300x167.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-768x426.jpg.webp 768w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20555'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20555'%3E%3C\/svg%3E\" alt=\"Beautifulsoup\" width=\"1000\" height=\"555\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-300x167.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-768x426.jpg 768w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-full wp-image-21442\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-300x167.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-768x426.jpg.webp 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup.jpg\" alt=\"Beautifulsoup\" width=\"1000\" height=\"555\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-300x167.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup-768x426.jpg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<div class=\"su-quote su-quote-style-modern-blue\">\n<div class=\"su-quote-inner su-u-clearfix su-u-trim\">\n<h4><span class=\"ez-toc-section\" id=\"TLDR_%E2%80%93_Basic_steps_to_use_BeautifulSoup_for_web_scraping_in_Python\"><\/span>TL;DR \u2013 Basic steps to use BeautifulSoup for web scraping in Python.<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>BeautifulSoup is a Python library used for web scraping purposes to pull the data out of HTML and XML files. Here are the steps to use BeautifulSoup for web scraping:<\/p>\n<ol>\n<li>Install BeautifulSoup: Use the command <code>pip install beautifulsoup4<\/code> in the terminal or command prompt to install the BeautifulSoup library.<\/li>\n<li>Import Library: Import the BeautifulSoup library and the requests library in your Python code with the following code:<\/li>\n<\/ol>\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><em><span class=\"\">python<\/span><\/em><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-python\"><span class=\"hljs-keyword\">from<\/span> bs4 <span class=\"hljs-keyword\">import<\/span> BeautifulSoup<br \/>\n<span class=\"hljs-keyword\">import<\/span> requests<br \/>\n<\/code><\/div>\n<\/div>\n<ol start=\"3\">\n<li>Send HTTP Request: Use the <code>requests.get()<\/code> method to send an HTTP request to the URL of the webpage you want to scrape, and store the response in a variable.<\/li>\n<\/ol>\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><span class=\"\">csharp<\/span><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-csharp\">response = requests.<span class=\"hljs-keyword\">get<\/span>(<span class=\"hljs-string\">'https:\/\/www.example.com'<\/span>)<br \/>\n<\/code><\/div>\n<\/div>\n<ol start=\"4\">\n<li>Parse HTML: Use the <code>BeautifulSoup<\/code> function to parse the HTML content of the response and store it in a BeautifulSoup object.<\/li>\n<\/ol>\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><span class=\"\">scss<\/span><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-scss\">soup = <span class=\"hljs-built_in\">BeautifulSoup<\/span>(response.text, 'html.parser')<br \/>\n<\/code><\/div>\n<\/div>\n<ol start=\"5\">\n<li>Extract Data: Use methods such as <code>find()<\/code>, <code>find_all()<\/code>, and <code>select()<\/code> to search for and extract the data from the HTML content.<\/li>\n<\/ol>\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><span class=\"\">lua<\/span><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-lua\">title = soup.<span class=\"hljs-built_in\">find<\/span>(<span class=\"hljs-string\">'title'<\/span>).text<br \/>\n<\/code><\/div>\n<\/div>\n<ol start=\"6\">\n<li>Save Data: Store the extracted data in a variable or write it to a file for further processing.<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<hr\/>\n<p>There are basically two steps to web scraping. The first step is to send a web request to get the HTML of a web page while the second step involves parsing out and extracting the required data from the HTML downloaded.<\/p>\n<p>Our focus in this article is on the second step \u2013 extracting data from web pages. As a Python developer, you will agree with me that the standard parser that comes included in the standard library is nearly impossible to use except if you have advanced knowledge.<\/p>\n<p>this lead to the demand for simpler alternatives and Beautifulsoup for now, is the number one library for extracting data from web psge document. It is mostly used along requests but sometimes, developers use it with Selenium too. This article will show you how to use Beautifulsoup for extracting data from web pages.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"What_is_Beautifulsoup\"><\/span><strong>What is Beautifulsoup?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\"><\/p>\n<div class=\"su-youtube su-u-responsive-media-yes\">\n<div class=\"perfmatters-lazy-youtube\" data-src=\"https:\/\/www.youtube.com\/embed\/5JT_vgrrKgY\" data-id=\"5JT_vgrrKgY\" data-query=\"\" onclick=\"if (!window.__cfRLUnblockHandlers) return false; perfmattersLazyLoadYouTube(this);\" data-cf-modified-395123c7230329bdd5941689-=\"\">\n<div><img loading=\"lazy\" decoding=\"async\" class=\"perfmatters-lazy\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%20480%20360%3E%3C\/svg%3E\" data-src=\"https:\/\/i.ytimg.com\/vi\/5JT_vgrrKgY\/hqdefault.jpg\" alt=\"YouTube video\" width=\"480\" height=\"360\" data-pin-nopin=\"true\"\/><\/p>\n<div class=\"play\"\/><\/div>\n<\/div>\n<p><noscript><iframe loading=\"lazy\" width=\"600\" height=\"400\" src=\"https:\/\/www.youtube.com\/embed\/5JT_vgrrKgY?\" frameborder=\"0\" allowfullscreen=\"\" allow=\"autoplay; encrypted-media; picture-in-picture\" title=\"\"\/><\/noscript><\/div>\n<p><\/span><\/p>\n<p>Beautifulsoup is a python web scraping package that allows the parsing and scraping of HTML and XML pages and document. It is quite a diverse tool in terms of extracting data as it can separate what is on a webpage with only a few lines of code from your end.<\/p>\n<p>If you are a python programmer who primarily works with web scraping, you can imagine how time-consuming the job would be if the right tool was not available; this is one of Beautifulsoup&#8217;s distinguishing features. It is important you know that this library is not a parser in itself.<\/p>\n<p>It makes use of a parser such as the standard HTML. Parser or even a third-party parser like the lxml. Before extraction, the Python parser interprets to ensure that all syntax makes sense, and when BeautifulSoup is used for extraction, the data is converted to the desired file type.<\/p>\n<p>The three major functions that encompass the usefulness of this python scraper are that it is capable of extracting, navigating data, and filtering the values of the content of a web page document.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Parsing_a_Page_with_Beautifulsoup\"><\/span><strong>Parsing a Page with Beautifulsoup<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><picture class=\"aligncenter size-full wp-image-21446 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup.png.webp 822w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-300x157.png.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-768x402.png.webp 768w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%20822%20430'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 822px) 100vw, 822px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%20822%20430'%3E%3C\/svg%3E\" alt=\"Parsing a Page with Beautifulsoup\" width=\"822\" height=\"430\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup.png\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup.png 822w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-300x157.png 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-768x402.png 768w\" data-sizes=\"(max-width: 822px) 100vw, 822px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-full wp-image-21446\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup.png.webp 822w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-300x157.png.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-768x402.png.webp 768w\" sizes=\"(max-width: 822px) 100vw, 822px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup.png\" alt=\"Parsing a Page with Beautifulsoup\" width=\"822\" height=\"430\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup.png 822w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-300x157.png 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Parsing-a-Page-with-Beautifulsoup-768x402.png 768w\" sizes=\"(max-width: 822px) 100vw, 822px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>Parsing is the key functionality to understanding how to use Beautifulsoup in python web scraping. In this section of the tutorial we will be showing you what\u2019s involve in parsing a page with Beautifulsoup. Before doing that, you need to have Python installed. we highly recommend you install the Pycharm IDE for this tutorial. there is a community edition that you can use for free.<strong>\u00a0<\/strong><\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Downloading_and_installing_PyCharm\"><\/span><strong>Downloading and installing PyCharm<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before downloading PyCharm for coding Python, it is important to make sure you have Python installed on your computer, especially if you are new to programming in this language. To install Python, follow these quick steps below.<\/p>\n<p><strong>Step 1:<\/strong> Visit the official Python website, <a href=\"https:\/\/www.python.org\/downloads\/\"  rel=\"noopener noreferrer nofollow\">here<\/a>. There are different versions to choose from. We suggest you go for the latest version, as we will be using that for this tutorial: Python (version 3.11.1).<\/p>\n<p><picture class=\"aligncenter wp-image-21381 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website.jpg.webp 1432w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" alt=\"Python Official Website\" width=\"1000\" height=\"562\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website.jpg 1432w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21381\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website.jpg.webp 1432w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-1024x576.jpg\" alt=\"Python Official Website\" width=\"1000\" height=\"562\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Official-Website.jpg 1432w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 2:<\/strong> When you are done downloading, run the downloaded.exe file by clicking \u201c<strong>Install Now\u201d<\/strong>\u00a0to install it on your machine.<\/p>\n<p><picture class=\"aligncenter wp-image-21373 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Install Python latest version\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21373\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1024x576.jpg\" alt=\"Install Python latest version\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Install-Python-latest-version.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 3:<\/strong> When the installation is done and successful, you should see a dialog box pop up like the one below. Click <strong>Close<\/strong> to shut down the dialog box and finish your Python installation.<\/p>\n<p><picture class=\"aligncenter wp-image-21382 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Python Successful Setup\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21382\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1024x576.jpg\" alt=\"Python Successful Setup\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Successful-Setup.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>The next step would be to download and install PyCharm as well.<\/p>\n<p><strong>Step 4:<\/strong> To download PyCharm, visit <a href=\"https:\/\/www.jetbrains.com\/pycharm\/download\/#section=windows\"  rel=\"noopener noreferrer nofollow\">here<\/a>.<\/p>\n<p><strong>Step 5:<\/strong> You should see the options to download either the professional or community version. Depending on which one you want, go ahead and click the <strong>download button<\/strong>. At the time of writing this article, JetBrains is offering a 30-day trial for the professional version of PyCharm.<\/p>\n<p><picture class=\"aligncenter wp-image-21367 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm.jpg.webp 1432w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" alt=\"30-day trial for the professional version of PyCharm\" width=\"1000\" height=\"562\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm.jpg 1432w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21367\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm.jpg.webp 1432w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-1024x576.jpg\" alt=\"30-day trial for the professional version of PyCharm\" width=\"1000\" height=\"562\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/30-day-trial-for-the-professional-version-of-PyCharm.jpg 1432w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 6:<\/strong> After downloading, run the.exe file to begin installation. Click <strong>Next<\/strong> when you see the setup wizard pop up.<\/p>\n<p><picture class=\"aligncenter wp-image-21372 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Click Next when you see the setup wizard pop up\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21372\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1024x576.jpg\" alt=\"Click Next when you see the setup wizard pop up\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-when-you-see-the-setup-wizard-pop-up.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 7:<\/strong> The following window would show the path to where PyCharm would be installed. If necessary, you can alter the path. Click <strong>Next <\/strong>to move forward.<\/p>\n<p><picture class=\"aligncenter wp-image-21371 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Click Next to move forward\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21371\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1024x576.jpg\" alt=\"Click Next to move forward\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Click-Next-to-move-forward-1.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 8:<\/strong> You would be given the option to create associations, a desktop shortcut, a context menu update, a PATH variable update, or all of these in the following popup. To proceed, select the choices you want and click <strong>Next<\/strong>. You may continue without selecting any boxes.<\/p>\n<p><picture class=\"aligncenter wp-image-21377 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"PATH variable update\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21377\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1024x576.jpg\" alt=\"PATH variable update\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/PATH-variable-update.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 9:<\/strong> After this, select your start menu folder. By default, you should see JetBrains. You can leave it like that and click <strong>Install<\/strong>.<\/p>\n<p><picture class=\"aligncenter size-large wp-image-21386 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201024%20576'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201024%20576'%3E%3C\/svg%3E\" alt=\"You can leave it like that and click Install\" width=\"1024\" height=\"576\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install.jpg 1920w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-large wp-image-21386\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install.jpg.webp 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1024x576.jpg\" alt=\"You can leave it like that and click Install\" width=\"1024\" height=\"576\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/You-can-leave-it-like-that-and-click-Install.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 10:<\/strong> Wait for some minutes for the installation to complete. When it is done, you should see the next window like the one below. You can tick the box right next to <strong>Run PyCharm <\/strong>and click <strong>Next<\/strong> to launch PyCharm right away.<\/p>\n<p><picture class=\"aligncenter wp-image-21383 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Run PyCharm and click Next to launch PyCharm right away\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21383\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1024x576.jpg\" alt=\"Run PyCharm and click Next to launch PyCharm right away\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Run-PyCharm-and-click-Next-to-launch-PyCharm-right-away.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>That\u2019s it. We are done setting up the Python IDE we need. Let\u2019s move on to installing the beautiful soup library we need for this tutorial.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Installing_BeautifulSoup\"><\/span><strong>Installing BeautifulSoup<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now that the installation of Python and PyCharm is complete, click on <strong>Create New Project <\/strong>to start writing your codes and, most importantly, install the beautifulsoup library. The PyCharm window should look like this.<\/p>\n<p><picture class=\"aligncenter wp-image-21374 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Installing BeautifulSoup\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21374\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1024x576.jpg\" alt=\"Installing BeautifulSoup\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Installing-BeautifulSoup.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>Follow the instructions below to begin installing Beautiful Soup:<\/p>\n<p><strong>Step 1:<\/strong> To select it, pick File from the menu bar and then scroll down to Settings.<\/p>\n<p><picture class=\"aligncenter wp-image-21378 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Pick File from the menu bar and then scroll down to Settings\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21378\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1024x576.jpg\" alt=\"Pick File from the menu bar and then scroll down to Settings\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Pick-File-from-the-menu-bar-and-then-scroll-down-to-Settings.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 2:<\/strong> The Settings dialog box would pop up. On the side menu, scroll down to select <strong>Project:pythonProject1. <\/strong>Your own project name may be different, but you will be sure to see the <strong>Project:<\/strong> drop-down menu. Under this, select <strong>Python<\/strong> <strong>Interpreter<\/strong>. To add a new library, click the plus (+) symbol on the top left, above the list of packages.<\/p>\n<p><picture class=\"aligncenter wp-image-21389 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Python Project 1 Installer\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21389\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1024x576.jpg\" alt=\"Python Project 1 Installer\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Installer.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><picture class=\"aligncenter wp-image-21390 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Python Project Install short code\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21390\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1024x576.jpg\" alt=\"Python Project Install short code\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-Install-short-code.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 3:<\/strong> An available packages window would pop up with a search bar. Go ahead and type <strong>beautifulsoup <\/strong>into the search bar. A list will appear, but make sure to choose <strong>beautifulsoup4<\/strong>. Click <strong>Install Package <\/strong>below when you are done selecting the beautiful soup.<\/p>\n<p><picture class=\"aligncenter size-full wp-image-21391 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-768x432.jpg.webp 768w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" alt=\"Beutyfulsoap 4 available packages\" width=\"1000\" height=\"562\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-768x432.jpg 768w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-full wp-image-21391\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-768x432.jpg.webp 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages.jpg\" alt=\"Beutyfulsoap 4 available packages\" width=\"1000\" height=\"562\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beutyfulsoap-4-available-packages-768x432.jpg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>When it is done installing, you should see this message below.<\/p>\n<p><picture class=\"aligncenter wp-image-21375 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20563'%3E%3C\/svg%3E\" alt=\"Manage Repositories\" width=\"1000\" height=\"563\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories.jpg 1920w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21375\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories.jpg.webp 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1024x576.jpg\" alt=\"Manage Repositories\" width=\"1000\" height=\"563\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Manage-Repositories.jpg 1920w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>You should now see that it has been updated on your PyCharm Python packages, as shown in the image below. Click<strong> OK,<\/strong> and go back to the editor to import the library we just installed.<\/p>\n<p><picture class=\"aligncenter size-full wp-image-21392 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-768x432.jpg.webp 768w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" alt=\"Python Project 1 Interpreter\" width=\"1000\" height=\"562\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-768x432.jpg 768w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-full wp-image-21392\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-768x432.jpg.webp 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter.jpg\" alt=\"Python Project 1 Interpreter\" width=\"1000\" height=\"562\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-1-Interpreter-768x432.jpg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Step 4:<\/strong> In your editor, type the follow code.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre>from bs4 import BeautifulSoup<\/pre>\n<p><strong>Step 5:<\/strong> When you right-click on the editor and scroll down to select <strong>\u201cRun Main,\u201d <\/strong>you would see this below in your PyCharm terminal.<\/p>\n<p><picture class=\"aligncenter size-full wp-image-21393 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-768x432.jpg.webp 768w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20562'%3E%3C\/svg%3E\" alt=\"BS4 Import beutyfulsoap\" width=\"1000\" height=\"562\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-768x432.jpg 768w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-full wp-image-21393\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap.jpg.webp 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-768x432.jpg.webp 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap.jpg\" alt=\"BS4 Import beutyfulsoap\" width=\"1000\" height=\"562\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap.jpg 1000w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/BS4-Import-beutyfulsoap-768x432.jpg 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>We have successfully installed Beautiful Soup. Now we would move on to the parsing of data with beautifulsoup in the PyCharm IDE.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Using_BeautifulSoup_to_parse_a_page\"><\/span><strong>Using BeautifulSoup to parse a page<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>As we mentioned earlier, beautifulsoup is a Python library known for parsing HTML data in particular. However, before we move forward, it is important to know how to inspect the web page we aim to scrape and the benefits that come with this.<\/p>\n<hr\/>\n<h3><span class=\"ez-toc-section\" id=\"1_Inspecting_the_Source_Code_of_the_Website\"><\/span><strong>1. Inspecting the Source Code of the Website<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><picture class=\"aligncenter size-full wp-image-21447 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website.jpg.webp 900w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-300x157.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-768x403.jpg.webp 768w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%20900%20472'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 900px) 100vw, 900px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%20900%20472'%3E%3C\/svg%3E\" alt=\"Inspecting the Source Code of the Website\" width=\"900\" height=\"472\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website.jpg 900w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-300x157.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-768x403.jpg 768w\" data-sizes=\"(max-width: 900px) 100vw, 900px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-full wp-image-21447\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website.jpg.webp 900w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-300x157.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-768x403.jpg.webp 768w\" sizes=\"(max-width: 900px) 100vw, 900px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website.jpg\" alt=\"Inspecting the Source Code of the Website\" width=\"900\" height=\"472\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website.jpg 900w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-300x157.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Inspecting-the-Source-Code-of-the-Website-768x403.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>To inspect the source code of whichever website you want to scrape is the first attribute to considered while parsing a page with Beautifulsoup. What you should take note is that there are several engagements here, it doesn\u2019t involve just a phase.<\/p>\n<p>Inspecting the source code of any website is very crucial and should be clearly understood before taking on a precise scraping task, why because, a mistake can lead to wrong extraction or gathering of data.<\/p>\n<p>However, before you sit to structure any python code, surf to be acquaint yourself with the website you wish to retrieve its data, know the way they design their site and everything necessary to see you through achieving you aim. After that try to open the site with your choice of browser, and carryout the following:<\/p>\n<hr\/>\n<h3><span class=\"ez-toc-section\" id=\"2_Explore_the_Website\"><\/span><strong>2. Explore the Website<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Exploring in this context simply hit on taking a walk around the website. For instance, you are a digital marketer who intent to scrape an e-commerce store to get a glimpse of competitor\u2019s current price list and operational standard or module operandi.<\/p>\n<p>After opening to access the website, you click through to engage in whatever activities that are of importance just like other customers would do. Check prices of goods, scroll to read through guides and everything needed to help you find your way around the site.<\/p>\n<p>Try to want to purchase something to see how the designs and structure as well as price values looks. This is important because the more you search, the more descriptive and detailed information you are likely to find.<\/p>\n<p>Also, every home page, services and about us page details you click changes the URL. That should be taking note of because it will help simplify your main target, and broaden your understanding of the websites addresses and how the syntax changes.<\/p>\n<hr\/>\n<h3><span class=\"ez-toc-section\" id=\"3_Decrypt_the_Information_in_URLs\"><\/span><strong>3. Decrypt the Information in URLs<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If the above homework is done correctly, you can go ahead to decode, Interpret or read the web address to acquaint yourself with how the URL is wired. Let\u2019s not forget that this is integral if you\u2019re a programmer trying to scrape data from your site of interest.<\/p>\n<p>Remember that this applies to the entire site because if you don&#8217;t know anything about it or haven&#8217;t done extensive research to explore the site, your scraping driver will be defeated.<\/p>\n<p>To read any URL, you have to know the structure of URLs. What this mean is that, the part of the URLs carrying the HTML file is different from that of the exact search. The specific file location is the most important because it is where the unique resource of the website is.<\/p>\n<p>Take for example you punch on your browser <a href=\"https:\/\/www.amazon.com\"  rel=\"noopener noreferrer nofollow\">http:\/\/www.amazon.com<\/a> when the site opens and you click on the customer service, the site URL will change to this <a href=\"https:\/\/www.amazon.com\/gp\/help\/customer\/display.html?nodeId=508510&#038;ref_=nav_cs_customerservice\"  rel=\"noopener noreferrer nofollow\">Link<\/a>.<\/p>\n<p><picture class=\"aligncenter wp-image-21385 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-1024x478.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-300x140.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-768x359.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL.jpg.webp 1326w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20467'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201000%20467'%3E%3C\/svg%3E\" alt=\"Visit Amazon URL\" width=\"1000\" height=\"467\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-1024x478.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-1024x478.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-300x140.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-768x359.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL.jpg 1326w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter wp-image-21385\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-1024x478.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-300x140.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-768x359.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL.jpg.webp 1326w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-1024x478.jpg\" alt=\"Visit Amazon URL\" width=\"1000\" height=\"467\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-1024x478.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-300x140.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL-768x359.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Visit-Amazon-URL.jpg 1326w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p>You can see that there is a clear difference compared to what you loaded initially. This tells you that the URL can be the same, but the precise parameter you are after has its own uniqueness. If you click on Today\u2019s Deal, the URL will appear the same with a different HTML.<\/p>\n<p>However, the URL is a big deal when accessing any website because its query parameters have unique syntax. Hence, the more you interact with the website, the more changes you see. The query parameter of a URL consists of three attributes: start, data, and separator.<\/p>\n<p>Thus, when you can analyze the URL of your target site correctly, your task becomes even easier. Let&#8217;s analyze the query parameter of the above customer service URL using the three query attributes:<\/p>\n<ul>\n<li>\n<h4><span class=\"ez-toc-section\" id=\"Start\"><\/span><strong>Start <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<\/li>\n<\/ul>\n<p>The start tells you the point where the specific HTML details begin. The question mark syntax (?) is used to represent it. Take note of this.<\/p>\n<ul>\n<li>\n<h4><span class=\"ez-toc-section\" id=\"Data\"><\/span><strong>Data<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<\/li>\n<\/ul>\n<p>Data describes the information contained in a specific URL query parameter, which is encoded by the assignment operator, i.e., the equal sign (=). This syntax often joins keys and values that connect together.<\/p>\n<ul>\n<li>\n<h4><span class=\"ez-toc-section\" id=\"Separator\"><\/span><strong>Separator<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<\/li>\n<\/ul>\n<p>This is the ampersand sign between the key value and the ref. The interesting feature of a URL is its ability to change upon every command, so make sure you understand this syntax. It will help you scrape correctly.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Use_Developer_Tools_to_Inspect_the_Site\"><\/span><strong>Use Developer Tools to Inspect the Site<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Another parameter to consider when inspecting any website, you intend to scrape is developer tools.<\/p>\n<p>Just as stated above, knowing the structure of the website you intend to scrape is a top priority as that is a determinant. to the document you need. This context is where the developer tool comes into play. The developer&#8217;s tool will help you understand the structure of the site you want to scrape. Interestingly, every advanced browser has this tool installed, although it differs in system type. It is not as accessible on Windows and Linux as it is on macOS.<\/p>\n<p>To open the developer tool in Chrome, open the Chrome menu in the upper right-hand corner of the browser and select More Tools > Developer Tools. Also, on macOS, you can use Option + \u2318 + J to access its shortcut, while on Windows and Linus, you can use Shift + CTRL + J to gain quick access.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Finding_elements_by_ID\"><\/span><strong>Finding elements by ID<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Having inspected the page, finding elements by ID is quite easy and straightforward. Just make sure your beautiful soup library is installed and up to date.<\/p>\n<p><strong>Step 1:<\/strong> The first thing we are going to do is import the Beautiful Soup library.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre>from bs4 import BeautifulSoup<\/pre>\n<p><strong>Step 2:<\/strong> The following step is to add requests to the library. This is a good time to get the source code for our target page. In this case, the URL is <a href=\"https:\/\/amazon.com\">https:\/\/amazon.com<\/a>. To do this, input the following code:<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre><strong>import <\/strong><strong>requests<\/strong>\n\n\n\n<strong>r = requests.get (<\/strong><strong>\"https:\/\/www.amazon.com\/s?k=gaming+mouse\"<\/strong><strong>)<\/strong><\/pre>\n<p><strong>Step 3:<\/strong> You should convert the HTML code into a BeautifulSoup object, commonly known as <strong>soup<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre><strong>soup = BeautifulSoup(r.content<\/strong><strong>,<\/strong><strong>\"html.parser\"<\/strong><strong>)<\/strong><\/pre>\n<p><strong>Step 4:<\/strong> Make sure to cross-check the specific ID you intend to parse. This is important because the IDs of elements are unique. Therefore, we would be using the find method. You can use <strong>soup.find all(id=\u201dvalue\u201d)<\/strong> but since its ID is unique, you can just use <strong>soup.find all(id=\u201dvalue\u201d).<\/strong> Besides, locating it shouldn\u2019t be that difficult. The following code below shows how to get it done.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre><strong>element_by_id = soup.find(<\/strong><strong>\"div\"<\/strong><strong>, <\/strong><strong>{<\/strong><strong>\"id\"<\/strong><strong>:<\/strong><strong>\"a-page\"<\/strong><strong>})<\/strong><\/pre>\n<p>You would notice that in the above code, we first declared the tag before declaring the ID.<\/p>\n<p>The entire line of code should look like this.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre>from bs4 import BeautifulSoup\n\n\n\nimport requests\n\n\n\nr= requests.get (\"https:\/\/www.amazon.com\/s?k=gaming+mouse\")\n\n\n\nsoup = BeautifulSoup(r.content,\"html.parser\")\n\n\n\nelement_by_id = soup.find(\"div\", {\"id\":\"a-page\"})<\/pre>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Finding_elements_by_Class_Name\"><\/span><strong>Finding elements by Class Name<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Similarly, you can still select HTML elements by class name. This time you have to use the <strong>find_by_class<\/strong> method. The code should look like the one below.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre>from bs4 import BeautifulSoup\n\n\n\nimport requests\n\n\n\nr=requests.get (\"https:\/\/www.amazon.com\/s?k=gaming+mouse\")\n\n\n\nsoup=BeautifulSoup(r.content,\"html.parser\")\n\n\n\nelement_by_class=soup.find(\"div\", class_=\"a-size-medium\")<\/pre>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Extracting_text_form_HTML_element\"><\/span><strong>Extracting text form HTML element<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Let\u2019s say you are interested in scraping paragraphs from web pages. Using the requests and bs4 method we discussed earlier, Python&#8217;s BeautifulSoup library can assist you in obtaining that.<\/p>\n<p><strong>code:<\/strong><\/p>\n<pre>import module\n\n\n\nimport requests\n\n\n\nfrom bs4 import BeautifulSoup\n\n\n\n# link for extract html data\n\n\n\ndef getdata(url):\n\n\n\n\u00a0\u00a0 r = requests.get(url)\n\n\n\n\u00a0\u00a0 return r.text\n\n\n\nhtmldata = getdata(\"# import module\n\n\n\nimport requests\n\n\n\nfrom bs4 import BeautifulSoup\n\n\n\n# link for extract html data\n\n\n\ndef getdata(url):\n\n\n\n\u00a0\u00a0 r = requests.get(url)\n\n\n\n\u00a0\u00a0 return r.text\n\n\n\nhtmldata = getdata(\"https:\/\/blog.casaomnia.it\/en\/indispensable-kitchen-utensils\/\")\n\n\n\nsoup = BeautifulSoup(htmldata, 'html.parser')\n\n\n\ndata = ''\n\n\n\nfor data in soup.find_all(\"p\"):\n\n\n\n\u00a0\u00a0 print(data.get_text())\n\n\n\n\")\n\n\n\nsoup = BeautifulSoup(htmldata, 'html.parser')\n\n\n\ndata = ''\n\n\n\nfor data in soup.find_all(\"p\"):\n\n\n\n\u00a0\u00a0 print(data.get_text())<\/pre>\n<p>The approach in the code above is to import a module and then create an HTML document. In this, we can specify the <strong><\/p>\n<p><\/strong> tag into the code.<\/p>\n<p>Next is to pass the HTML document into the beautifulsoup() function, and then use the <strong>P<\/strong>\u00a0tag to extract paragraphs from the beautifulsoup object. Meanwhile, get_text() helps get text from the HTML document.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Exporting_data_to_a_CSV_file\"><\/span><strong>Exporting data to a CSV file<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now that we have gone through how to pass HTML and XML data, it&#8217;s time to see how to save the data you scrape for later use.<\/p>\n<p>First, we need to install the Pandas library. This library helps Python store and generate structured data. To install the library, you can either follow the steps we followed for the BeautifulSoup library or add the following lines of code.<\/p>\n<p><picture class=\"aligncenter size-large wp-image-21370 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201024%20576'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201024%20576'%3E%3C\/svg%3E\" alt=\"Beautifulsoup4 Install Pakeges\" width=\"1024\" height=\"576\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges.jpg 1920w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-large wp-image-21370\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges.jpg.webp 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1024x576.jpg\" alt=\"Beautifulsoup4 Install Pakeges\" width=\"1024\" height=\"576\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Beautifulsoup4-Install-Pakeges.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><picture class=\"aligncenter size-large wp-image-21387 perfmatters-lazy\" loading=\"lazy\"><source type=\"image\/webp\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2.jpg.webp 1920w\" srcset=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201024%20576'%3E%3C\/svg%3E\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\"\/><img decoding=\"async\" src=\"data:image\/svg+xml,%3Csvg%20xmlns='http:\/\/www.w3.org\/2000\/svg'%20viewBox='0%200%201024%20576'%3E%3C\/svg%3E\" alt=\"Python Project 2\" width=\"1024\" height=\"576\" data-src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1024x576.jpg\" data-srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2.jpg 1920w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" loading=\"lazy\"\/>\n<\/picture>\n<noscript><picture class=\"aligncenter size-large wp-image-21387\"><source type=\"image\/webp\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1024x576.jpg.webp 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-300x169.jpg.webp 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-768x432.jpg.webp 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1536x864.jpg.webp 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2.jpg.webp 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"\/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1024x576.jpg\" alt=\"Python Project 2\" width=\"1024\" height=\"576\" srcset=\"https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1024x576.jpg 1024w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-300x169.jpg 300w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-768x432.jpg 768w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2-1536x864.jpg 1536w, https:\/\/royadata.io\/blog\/wp-content\/uploads\/2023\/10\/Python-Project-2.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\"\/>\n<\/picture>\n<\/noscript><\/p>\n<p><strong>Code:<\/strong><\/p>\n<p>pip install pandas<\/p>\n<p>or<\/p>\n<p><em>#Add this to your code<\/em>.<\/p>\n<p>import pandas as pd<\/p>\n<p>After installing Pandas, input the code below to export your data to CSV.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre>import pandas as pd\n\n\n\nfrom bs4 import BeautifulSoup\n\n\n\npath = 'https:\/\/www.iban.com\/dialing-codes.html'\n\n\n\ndata = []\n\n\n\n# To get the header from the HTML file\n\n\n\nlist_header = []\n\n\n\nsoup = BeautifulSoup(open(path), 'html.parser')\n\n\n\nheader = soup.find_all(\"table\")[0].find(\"tr\")\n\n\n\nfor items in header:\n\n\n\n\u00a0\u00a0 try:\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 list_header.append(items.get_text())\n\n\n\n\u00a0\u00a0 except:\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 continue\n\n\n\n# Fetching the data\n\n\n\nHTML_data = soup.find_all(\"table\")[0].find_all(\"tr\")[1:]\n\n\n\nfor element in HTML_data:\n\n\n\n\u00a0\u00a0 sub_data = []\n\n\n\n\u00a0\u00a0 for sub_element in element:\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 try:\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sub_data.append(sub_element.get_text())\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 except:\n\n\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 continue\n\n\n\n\u00a0\u00a0 data.append(sub_data)\n\n\n\n# Storing the data into Pandas DataFrame\n\n\n\ndataFrame = pd.DataFrame(data=data, columns=list_header)\n\n\n\n# Converting Pandas DataFrame into CSV file\n\n\n\ndataFrame.to_csv('Tables.csv')<\/pre>\n<p>Having successfully imported the Pandas library with either of both methods, beautiful would help fetch the document header form the HTML file after which it would go ahead to fetch the table data proper. However, to store this data, Pandas library is needed. Here we introduce the library\u2019s DataFrame to store the data in CSV format.<\/p>\n<hr\/>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"FAQs_About_Beautifulsoup_Guide\"><\/span><strong>FAQs About Beautifulsoup Guide<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Q_Is_BeautifulSoup_a_Python_module\"><\/span><strong>Q. Is BeautifulSoup a Python module?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes, BeautifulSoup is a Python module. It is used to parse and scrape data from HTML and XML files. As a programmer whose major involvement deals in internet data scraping or extraction, you can imagine how exhausting and time-consuming it will be without the right scraping tool set to use in carrying out the activity.<\/p>\n<p>As such, when you use a tool like Beautifulsoup, which is specifically designed for scraping complex and diverse HTML websites, the time spent will be less and your goal will be more productively achievable.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Q_Do_I_need_to_Install_Beautifulsoup\"><\/span><strong>Q. Do I need to Install Beautifulsoup?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Beautifulsoup is not in the standard library, and thus, it needs to be installed before you can use it to extract any data. Beautifulsoup supports an HTML parser in the Python standard library. In addition, it also has support for many other external Python parsers, like the LXML parser, among other Python parsers. More so, in this tutorial, you learned hands-on how you can install this Python scraping tool.<\/p>\n<hr\/>\n<pre style=\"text-align: center;\"><strong>Conclusion<\/strong><\/pre>\n<p>Parsing important data from web page documents can be difficult because of the messy nature of how HTML pages are written by designers. As a Python web scraper developer, you do not need to worry too much about the complexities as Beautifulsoup can help you take care of the difficulties involved.<\/p>\n<p>The guide above shows you how to use the Beautifulsoup library in short. you should read the Beautifulsoup official documentation to learn how to make use of it in detail and for more complex usage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you new to Beautifulsoup? Then read the article below to learn how to use it for extracting data from web pages. we provide an up to date step by step guide to make it easier for you. TL;DR \u2013 Basic steps to use BeautifulSoup for web scraping in Python. BeautifulSoup is a Python library &#8230; <a title=\"How to Use Beautifulsoup for Python Scraping Webpages [Tutorial]\" class=\"read-more\" href=\"http:\/\/royadata.io\/blog\/how-to-use-beautifulsoup-for-python-scraping\/\" aria-label=\"More on How to Use Beautifulsoup for Python Scraping Webpages [Tutorial]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":162,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/posts\/5975"}],"collection":[{"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/comments?post=5975"}],"version-history":[{"count":0,"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/posts\/5975\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/media\/162"}],"wp:attachment":[{"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/media?parent=5975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/categories?post=5975"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/royadata.io\/blog\/wp-json\/wp\/v2\/tags?post=5975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}