{"id":28518,"date":"2024-03-18T11:05:10","date_gmt":"2024-03-18T05:35:10","guid":{"rendered":"https:\/\/codeforgeek.com\/?p=28518"},"modified":"2024-03-18T11:05:11","modified_gmt":"2024-03-18T05:35:11","slug":"wikipedia-module-in-python","status":"publish","type":"post","link":"https:\/\/codeforgeek.com\/wikipedia-module-in-python\/","title":{"rendered":"Wikipedia Module in Python: An In-Depth Guide"},"content":{"rendered":"\n<p>Welcome to a new tutorial, here we will learn about the Wikipedia Module in Python. We will see how we can achieve <strong>Data scraping<\/strong> using the Wikipedia API. Data scraping is the automated extraction of information from websites or other sources on the internet. Let&#8217;s see how we can use the most informative site on the internet i.e. Wikipedia in our Python applications. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">An Introduction to Wikipedia Module in Python<\/h2>\n\n\n\n<p>Wikipedia is a big online encyclopedia where people can work together to write and edit articles on many subjects. It&#8217;s a widely used reference site available in multiple languages. Wikipedia API is a Python tool that makes it easy to work with Wikipedia using code. It helps you find articles, get content and summaries, and access different details about Wikipedia entries. This tool lets you include Wikipedia information in your Python programs for various uses. Let&#8217;s learn about its installation and import.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Installation Statement<\/h3>\n\n\n\n<p>To get data from Wikipedia, start by installing the Wikipedia library. It wraps up the official Wikipedia API. Use the command below in your command prompt or terminal to install it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npip install wikipedia\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"206\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/installation-1024x206.png\" alt=\"Installation\" class=\"wp-image-28522\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/installation-1024x206.png 1024w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/installation-300x60.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/installation-768x154.png 768w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/installation.png 1086w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>After installing, we can utilize the Wikipedia API in Python to gather information from Wikipedia. To access the methods of the Wikipedia module, simply import it using the following command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nimport wikipedia\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Getting Started with Wikipedia Module<\/h2>\n\n\n\n<p>Let&#8217;s now look at different use cases of what we can do using this Wikipedia module.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Getting Wikipedia Articles Summary <\/h3>\n\n\n\n<p>Now, we will see how to use the Wikipedia module in Python. Let&#8217;s start with the basics. We can use the <strong>summary()<\/strong> method to extract a Wikipedia article&#8217;s summary in Python. We provide the article title as a parameter to this method, and it returns a specified number of sentences for the given title. To limit the stored data, you can include the desired number of sentences as a parameter, as shown in the following code.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nTitle = &quot;A. P. J. Abdul Kalam&quot;\n\n# Extract the summary with a specified number of sentences\nSummary = wikipedia.summary(Title, sentences=5)\nprint(&quot;According to wikipedia : &quot;)\nprint(Summary)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"957\" height=\"234\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary.png\" alt=\"Summary\" class=\"wp-image-28538\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary.png 957w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-300x73.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-768x188.png 768w\" sizes=\"(max-width: 957px) 100vw, 957px\" \/><figcaption class=\"wp-element-caption\">Summary of the given title<\/figcaption><\/figure>\n\n\n\n<p>The summary for the given title will be printed in a specified number of sentences i.e. 5.<\/p>\n\n\n\n<p>However, it is very important to note that the title provided must match the exact wording of the Wikipedia page&#8217;s title. If not, it will throw a <strong>disambiguation error<\/strong>, which means that the page does not exist. For example, if the title were:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nTitle = &quot;Dr APJ Abdul Kalam&quot;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"886\" height=\"103\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-2.png\" alt=\"Summary 2\" class=\"wp-image-28539\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-2.png 886w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-2-300x35.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-2-768x89.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/figure>\n\n\n\n<p>The output will display a disambiguation error and say that the given title does not match any pages.<\/p>\n\n\n\n<p>If there are many different articles with different meanings for the same title word, for example, &#8216;<strong>com<\/strong>,&#8217; where the page is disambiguated, it will show a disambiguation error.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nTitle = &quot;com&quot;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"894\" height=\"260\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary3.png\" alt=\"Summary 3\" class=\"wp-image-28540\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary3.png 894w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary3-300x87.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary3-768x223.png 768w\" sizes=\"(max-width: 894px) 100vw, 894px\" \/><\/figure>\n\n\n\n<p>Many results match the title &#8216;com&#8217;. Suppose we want to summarize &#8216;Center of mass&#8217;, then, we need to specify it in the title to get accurate results, like:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nTitle = &quot;Center of mass&quot;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"945\" height=\"185\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-4.png\" alt=\"Summary 4\" class=\"wp-image-28541\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-4.png 945w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-4-300x59.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/summary-4-768x150.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/figure>\n\n\n\n<p>Now, with a more specific query, the output displays the accurate summary.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Customizing the Page Language<\/h3>\n\n\n\n<p>The <strong>set_lang<\/strong> function in the Python Wikipedia module is used to choose the language for future queries. You can specify the Wikipedia edition&#8217;s language from which you want to get information.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n# Set the language to Hindi\nwikipedia.set_lang(&quot;hi&quot;)\n\nSummary = wikipedia.summary(&quot;Tiger&quot;)\nprint(&quot;According to wikipedia : &quot;)\nprint(Summary)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"969\" height=\"190\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/set_ang.png\" alt=\"Set Lang\" class=\"wp-image-28547\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/set_ang.png 969w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/set_ang-300x59.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/set_ang-768x151.png 768w\" sizes=\"(max-width: 969px) 100vw, 969px\" \/><\/figure>\n\n\n\n<p>In this example, using <strong>wikipedia.set_lang(&#8220;hi&#8221;)<\/strong> sets the language to Hindi. Afterwards, any queries with the Wikipedia module will get information from the Hindi edition. The <strong>summary<\/strong> function is then used to fetch a summary for the Hindi Wikipedia page titled &#8220;Tiger.&#8221;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Getting Wikipedia Page Data<\/h3>\n\n\n\n<p>We utilize the <strong>page<\/strong> function to obtain an entire Wikipedia page by providing the page title as a parameter. To extract specific information from the page object, we specify the exact details needed. The <strong>page<\/strong> function enables us to retrieve contents, categories, coordinates, images, links, and other metadata from a Wikipedia page. Let&#8217;s see the use of each page object one by one.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1) .content<\/h4>\n\n\n\n<p>When we use the <strong>page<\/strong> function, we retrieve the main content of a Wikipedia page using the <strong>.content<\/strong> attribute. Keep in mind that this content may include not only the main text but also sections, references, and other information from the page.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nTitle = &quot;William Shakespeare&quot;\n\nContent = wikipedia.page(Title).content\nprint(&quot;According to wikipedia : &quot;)\nprint(Content)\n\n<\/pre><\/div>\n\n\n<p><strong>Output<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"958\" height=\"187\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/content.png\" alt=\"Content\" class=\"wp-image-28542\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/content.png 958w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/content-300x59.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/content-768x150.png 768w\" sizes=\"(max-width: 958px) 100vw, 958px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">2) .url<\/h4>\n\n\n\n<p>If you wish to obtain the URL of the given page, you can use the <strong>.url<\/strong> attribute to fetch and display it.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nTitle = &quot;Walt Disney World&quot;\n\nURL = wikipedia.page(Title).url\nprint(&quot;According to wikipedia : &quot;)\nprint(URL)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"977\" height=\"119\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/URL.png\" alt=\"URL\" class=\"wp-image-28544\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/URL.png 977w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/URL-300x37.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/URL-768x94.png 768w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">3) .references<\/h4>\n\n\n\n<p>When we use the page function, employing the<strong> .references <\/strong>attribute is intended to retrieve the reference links or citations from a Wikipedia page.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nTitle = &quot;International Women&#039;s Day&quot;\n\nReferences = wikipedia.page(Title).references\nprint(&quot;According to wikipedia : &quot;)\nprint(References)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"974\" height=\"154\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/References.png\" alt=\"References\" class=\"wp-image-28545\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/References.png 974w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/References-300x47.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/References-768x121.png 768w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/><\/figure>\n\n\n\n<p>In this example, you have a list of URLs or identifiers representing the references or citations from the Wikipedia page for &#8220;International Women&#8217;s Day.&#8221; This information is helpful if you want to analyze or display the sources used in creating the Wikipedia page content.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4) .links<\/h4>\n\n\n\n<p>The <strong>.links<\/strong> attribute is used to retrieve a list of links present on a Wikipedia page.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nTitle = &quot;Santorini&quot;\n\nConnected_links = wikipedia.page(Title).links\nprint(&quot;According to wikipedia : &quot;)\nprint(Connected_links)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"980\" height=\"162\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/links.png\" alt=\"Links\" class=\"wp-image-28546\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/links.png 980w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/links-300x50.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/links-768x127.png 768w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/figure>\n\n\n\n<p>In this example, using <strong>wikipedia.page(Title).links<\/strong> gives you a list of links from the Wikipedia page for &#8220;Santorini.&#8221; Each element in the list represents a link found on the page. This information is helpful if you want to extract and analyze the links within the Wikipedia page or explore related topics. Note that the list may include different types of links, like internal links to other Wikipedia pages, external links, and references.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5) .categories<\/h4>\n\n\n\n<p>The <strong>.categories<\/strong> attribute is used to get a list of categories to which a Wikipedia page belongs.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nTitle = &quot;Hill Forts of Rajasthan&quot;\n\nBelonged_categories = wikipedia.page(Title).categories\nprint(&quot;According to wikipedia : &quot;)\nprint(Belonged_categories)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"961\" height=\"172\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/output-last.png\" alt=\"Categories\" class=\"wp-image-28872\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/output-last.png 961w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/output-last-300x54.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/output-last-768x137.png 768w\" sizes=\"(max-width: 961px) 100vw, 961px\" \/><\/figure>\n\n\n\n<p>In this example, using <strong>wikipedia.page(Title).categories<\/strong> gives you a list of categories related to the Wikipedia page for &#8220;Hill Forts of Rajasthan.&#8221; Each element in the list represents a category to which the page belongs. This is useful if you want to categorize Wikipedia pages based on their topics. Remember, the list of categories reflects how the Wikipedia community has organized and tagged the page&#8217;s content.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Getting a Random Wikipedia Page<\/h3>\n\n\n\n<p>The <strong>random<\/strong> method in Python&#8217;s Wikipedia module is used to get a random Wikipedia page. When you use <strong>wikipedia.random()<\/strong>, it gives you the title of a randomly chosen Wikipedia page, letting you explore various topics.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nRandom = wikipedia.random()\n\nTitle = wikipedia.page(Random).title\nSummary = wikipedia.summary(Random)\nprint(&quot;According to wikipedia : &quot;)\nprint(Title)\nprint(Summary)\n\n<\/pre><\/div>\n\n\n<p>The code randomly selects a Wikipedia page title using the <strong>wikipedia<\/strong> module, retrieves the title and a summary of the corresponding Wikipedia page, and prints this information to the console. It provides a quick way to explore diverse topics from Wikipedia.<\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"973\" height=\"142\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/random.png\" alt=\"Random\" class=\"wp-image-28548\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/random.png 973w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/random-300x44.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/random-768x112.png 768w\" sizes=\"(max-width: 973px) 100vw, 973px\" \/><\/figure>\n\n\n\n<p>The above result shows that the program has randomly selected the topic &#8220;<strong>Stielgranate 41<\/strong>&#8221; and has displayed the summary for the same.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Getting a List of Titles<\/h3>\n\n\n\n<p>The <strong>search<\/strong> method in Python&#8217;s Wikipedia module is used for searching on Wikipedia and getting a list of titles that match the query. It helps find Wikipedia pages related to a specific topic.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport wikipedia\n\nQuery = wikipedia.search(&quot;Rajasthan&quot;)\n\nprint(&quot;Search results:&quot;)\nfor result in Query:\n    print(result)\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"985\" height=\"277\" src=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/search.png\" alt=\"Search\" class=\"wp-image-28549\" srcset=\"https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/search.png 985w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/search-300x84.png 300w, https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/search-768x216.png 768w\" sizes=\"(max-width: 985px) 100vw, 985px\" \/><\/figure>\n\n\n\n<p>In this example, using <strong>wikipedia.search(&#8220;Rajasthan&#8221;)<\/strong> gives a list of Wikipedia page titles related to &#8220;Rajasthan.&#8221; This is helpful when you want to find relevant Wikipedia pages on a specific topic. The obtained titles can then be used to get more detailed information about the corresponding pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>And here we are at the end of this article. I hope that you are clear about the role of Wikipedia module in Python programming. Now you can confirm your understanding of the Wikipedia module by using it in your programs. <\/p>\n\n\n\n<p><em>If you enjoyed reading this, be sure to check out some of our other articles &#8211;<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/codeforgeek.com\/python-fpdf-module\/\"><em>Python fpdf Module \u2013 Beginners Guide<\/em><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/codeforgeek.com\/python-emoji-module\/\"><em>How to Use Emoji Module in Python (With Examples)<\/em><\/a><\/li>\n<\/ul>\n\n\n\n<p> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Reference<\/h2>\n\n\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/63682231\/using-wikipedia-module-in-python\" target=\"_blank\" rel=\"noopener\">https:\/\/stackoverflow.com\/questions\/63682231\/using-wikipedia-module-in-python<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to a new tutorial, here we will learn about the Wikipedia Module in Python. We will see how we can achieve Data scraping using the Wikipedia API. Data scraping is the automated extraction of information from websites or other sources on the internet. Let&#8217;s see how we can use the most informative site on [&hellip;]<\/p>\n","protected":false},"author":104,"featured_media":28551,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true,"_uag_custom_page_level_css":"","footnotes":""},"categories":[134],"tags":[],"class_list":["post-28518","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"blocksy_meta":[],"uagb_featured_image_src":{"full":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python.png",1200,600,false],"thumbnail":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python-150x150.png",150,150,true],"medium":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python-300x150.png",300,150,true],"medium_large":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python-768x384.png",768,384,true],"large":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python-1024x512.png",1024,512,true],"1536x1536":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python.png",1200,600,false],"2048x2048":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2024\/03\/The-Wikipedia-Module-in-python.png",1200,600,false]},"uagb_author_info":{"display_name":"Snigdha Keshariya","author_link":"https:\/\/codeforgeek.com\/author\/snigdha\/"},"uagb_comment_info":0,"uagb_excerpt":"Welcome to a new tutorial, here we will learn about the Wikipedia Module in Python. We will see how we can achieve Data scraping using the Wikipedia API. Data scraping is the automated extraction of information from websites or other sources on the internet. Let&#8217;s see how we can use the most informative site on&hellip;","_links":{"self":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts\/28518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/users\/104"}],"replies":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/comments?post=28518"}],"version-history":[{"count":0,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts\/28518\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/media\/28551"}],"wp:attachment":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/media?parent=28518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/categories?post=28518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/tags?post=28518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}