<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>data science Archives -</title>
	<atom:link href="https://mitindia.in/tag/data-science/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/data-science/</link>
	<description></description>
	<lastBuildDate>Wed, 20 Apr 2022 05:49:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>data science Archives -</title>
	<link>https://mitindia.in/tag/data-science/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Data Science &#8211; Web scraping (Access Share/BSE Market price)</title>
		<link>https://mitindia.in/data-science-web-scraping-access-share-bse-market-price/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Wed, 20 Apr 2022 05:49:14 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[data science]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[live market price]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1149</guid>

					<description><![CDATA[<p>Retrieve Live Market Price Accessing Share and Bombay Stock Exchange (BSE) Market price using Web scraping with the help of Python&#8217;s Beautiful Soup Package. In this example we covered TCS share price as an example. Here is the Python code to perform the task. #data science with Python - TCS share and BSE Market price [&#8230;]</p>
<p>The post <a href="https://mitindia.in/data-science-web-scraping-access-share-bse-market-price/">Data Science &#8211; Web scraping (Access Share/BSE Market price)</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Retrieve Live Market Price</h1>
<p>Accessing Share and Bombay Stock Exchange (BSE) Market price using Web scraping with the help of Python&#8217;s Beautiful Soup Package.</p>
<p>In this example we covered TCS share price as an example.</p>
<p>Here is the Python code to perform the task.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#data science with Python - TCS share and BSE Market price
import bs4 
import pandas as pd 
import requests 

url = 'https://www.google.com/finance/quote/TCS:NSE'
result = requests.get(url) 
soup = bs4.BeautifulSoup(result.text,'lxml') 

for row in soup.find_all('div',attrs={"class" : "YMlKec fxKbKc"}):
    print ("TCS Share price:", row.text)

url2='https://www.google.com/finance/quote/SENSEX:INDEXBOM'
result2 = requests.get(url2) 
soup2 = bs4.BeautifulSoup(result2.text,'lxml') 

for row2 in soup2.find_all('div',attrs={"class" : "YMlKec fxKbKc"}):
    print ("BSE Market price:", row2.text)
</pre>
<p>Output of the above code is :</p>
<blockquote><p><strong>TCS Share price: ₹3,562.20</strong><br />
<strong>BSE Market price: 56,988.59</strong></p>
<p>These values are retrieved live on any particular day when the market is open otherwise it shows previous day&#8217;s values.</p></blockquote>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-web-scraping-access-share-bse-market-price%2F&amp;linkname=Data%20Science%20%E2%80%93%20Web%20scraping%20%28Access%20Share%2FBSE%20Market%20price%29" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-web-scraping-access-share-bse-market-price%2F&amp;linkname=Data%20Science%20%E2%80%93%20Web%20scraping%20%28Access%20Share%2FBSE%20Market%20price%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fdata-science-web-scraping-access-share-bse-market-price%2F&#038;title=Data%20Science%20%E2%80%93%20Web%20scraping%20%28Access%20Share%2FBSE%20Market%20price%29" data-a2a-url="https://mitindia.in/data-science-web-scraping-access-share-bse-market-price/" data-a2a-title="Data Science – Web scraping (Access Share/BSE Market price)"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/data-science-web-scraping-access-share-bse-market-price/">Data Science &#8211; Web scraping (Access Share/BSE Market price)</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Graphs in Python</title>
		<link>https://mitindia.in/graphs-in-python/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Wed, 03 Feb 2021 06:30:16 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[data science]]></category>
		<category><![CDATA[graphs in python]]></category>
		<category><![CDATA[pie]]></category>
		<category><![CDATA[scatter]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1128</guid>

					<description><![CDATA[<p>Graphs [for Data Science] Graphs in Python : Graph represents graphical / pictorial representation of set of data. Due to continuous development of various packages / library files in python it is easy  and sophisticated way to show data in various graph format. [pie / bar / scatter / column charts] Before you run these [&#8230;]</p>
<p>The post <a href="https://mitindia.in/graphs-in-python/">Graphs in Python</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><span style="color: #003366;">Graphs</span> [<span style="color: #993300;">for <a href="https://www.mitindia.in/tag/data-science/" target="_blank" rel="noopener">Data Science</a></span>]</h1>
<p>Graphs in Python : Graph represents graphical / pictorial representation of set of data.</p>
<p>Due to continuous development of various packages / library files in python it is easy  and sophisticated way to show data in various graph format. [pie / bar / scatter / column charts]</p>
<p>Before you run these examples, install following packages.</p>
<p><span style="color: #333300;">a) pip install matplotlib [basic graphs]</span><br />
<span style="color: #333300;">b) pip install numpy [numeric python]</span><br />
<span style="color: #333300;">c) pip install pandas [panel data]</span><br />
<span style="color: #333300;">d) pip install plotly [for advanced and most sophisticated graphs]</span></p>
<p>Here are some examples.</p>
<ol>
<li><strong>The following example shows a particular company stock performance in given period. [here we took hdfc bank ltd example]</strong></li>
</ol>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#Analyzing particular share price in particular period 
import pandas as pd
#pip install plotly
import plotly.express as px
df = pd.read_csv('HBD.csv')
fig = px.line(df, x = 'HBD_x', y = 'HBD_y', title='HDFC Shares prices 2019-20')
fig.show()
</pre>
<p>To download HBD.csv file, click <a href="https://in.finance.yahoo.com/" target="_blank" rel="noopener">here</a> or you can google it.</p>
<p>Output of above example is :</p>
<p><img decoding="async" class="alignnone size-medium wp-image-1129" src="http://www.mitindia.in/wp-content/uploads/2021/02/map2-300x153.png" alt="MAP2" width="300" height="153" srcset="https://mitindia.in/wp-content/uploads/2021/02/map2-300x153.png 300w, https://mitindia.in/wp-content/uploads/2021/02/map2-768x391.png 768w, https://mitindia.in/wp-content/uploads/2021/02/map2-1024x522.png 1024w, https://mitindia.in/wp-content/uploads/2021/02/map2.png 1280w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><strong>2.  Student performance  </strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">import matplotlib.pyplot as plt
import csv
x=[]
y=[]
with open('student_data.csv', 'r') as csvfile:
    plots= csv.reader(csvfile, delimiter=',')
    for row in plots:
        x.append(str(row[0]))
        y.append(str(row[1]))
plt.plot(x,y, marker='o')
#plt.bar(x,y)
plt.title('Student Marks Information')
plt.xlabel('Names')
plt.ylabel('Marks')
plt.show()
</pre>
<p>Prepare .csv file as following for above example</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-1130" src="http://www.mitindia.in/wp-content/uploads/2021/02/prepare3-300x268.png" alt="" width="300" height="268" srcset="https://mitindia.in/wp-content/uploads/2021/02/prepare3-300x268.png 300w, https://mitindia.in/wp-content/uploads/2021/02/prepare3.png 316w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Output of above example is :</p>
<p><img decoding="async" class="alignnone size-medium wp-image-1132" src="http://www.mitindia.in/wp-content/uploads/2021/02/map3-300x188.png" alt="" width="300" height="188" srcset="https://mitindia.in/wp-content/uploads/2021/02/map3-300x188.png 300w, https://mitindia.in/wp-content/uploads/2021/02/map3-768x482.png 768w, https://mitindia.in/wp-content/uploads/2021/02/map3.png 882w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>&nbsp;</p>
<p><strong>3. Course enrollment details</strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#Data Visualizing using Python 
import numpy as np 
import matplotlib.pyplot as plt  
# creating the dataset 
data = {'C':20, 'C++':15, 'Java':30, 'Python':35} 
courses = list(data.keys()) 
values = list(data.values()) 
fig = plt.figure(figsize = (5, 2)) 
# creating the bar plot 
plt.bar(courses, values, color ='green', width = 0.5)
plt.xlabel("Courses offered") 
plt.ylabel("No. of students enrolled") 
plt.title("Students enrolled in different courses") 
plt.show() 
</pre>
<p>Output of above example is :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1133" src="http://www.mitindia.in/wp-content/uploads/2021/02/map4-300x150.png" alt="" width="300" height="150" srcset="https://mitindia.in/wp-content/uploads/2021/02/map4-300x150.png 300w, https://mitindia.in/wp-content/uploads/2021/02/map4.png 597w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><strong>4. Following example shows BSE [Bombay Stock Exchange] Market performance during &#8211; 2019-2020</strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="null"># BSE market data analysis - 2019-20
import pandas as pd
#pip install plotly
import plotly.express as px
df = pd.read_csv('BSESN.csv')
fig = px.line(df, x = 'Date', y='Value', title='BSE Market Price Analysis 2019-20') #use px.bar, px.scatter 
fig.show()
</pre>
<p>To download BSESN.csv file, click <a href="https://in.finance.yahoo.com/quote/%5EBSESN?p=%5EBSESN" target="_blank" rel="noopener">here</a> or you can google it.</p>
<p>Output of above example is :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1134" src="http://www.mitindia.in/wp-content/uploads/2021/02/map5-300x153.png" alt="" width="300" height="153" srcset="https://mitindia.in/wp-content/uploads/2021/02/map5-300x153.png 300w, https://mitindia.in/wp-content/uploads/2021/02/map5-768x391.png 768w, https://mitindia.in/wp-content/uploads/2021/02/map5-1024x522.png 1024w, https://mitindia.in/wp-content/uploads/2021/02/map5.png 1272w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><strong>5.  The following example[pie chart] shows population records from few Asian countries.</strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#Data Analysis and Visualization using  pie chart 
import plotly.express as px 
import numpy 
  
# Random Data 
random_x = [1300000000, 1450000000, 120000000, 12000000, 180000000] 
countries= ['India', 'China', 'Japan', 'Bangladesh', 'Pakistan'] 
  
fig = px.pie(values=random_x, names=countries, title='Asian countries population') 
fig.show()
</pre>
<p>Output of above example is :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1135" src="http://www.mitindia.in/wp-content/uploads/2021/02/map6-300x154.png" alt="" width="300" height="154" srcset="https://mitindia.in/wp-content/uploads/2021/02/map6-300x154.png 300w, https://mitindia.in/wp-content/uploads/2021/02/map6-768x394.png 768w, https://mitindia.in/wp-content/uploads/2021/02/map6-1024x526.png 1024w, https://mitindia.in/wp-content/uploads/2021/02/map6.png 1282w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p><strong>6. Now, following example shows India&#8217;s  increase in population, life expectancy , GDP / Per capita income etc from 1952 to 2007.</strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#population chart : lifexp, gdppercapita etc.
import plotly.express as px
data = px.data.gapminder()

data_india = data[data.country == 'India']
fig = px.bar(data_india, x='year', y='pop',
             hover_data=['lifeExp', 'gdpPercap'], color='lifeExp',
             labels={'pop':'population of India'}, height=400)
fig.show()
</pre>
<p>Output of above example is :</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-1136" src="http://www.mitindia.in/wp-content/uploads/2021/02/map8-300x120.png" alt="" width="300" height="120" srcset="https://mitindia.in/wp-content/uploads/2021/02/map8-300x120.png 300w, https://mitindia.in/wp-content/uploads/2021/02/map8-768x307.png 768w, https://mitindia.in/wp-content/uploads/2021/02/map8-1024x409.png 1024w, https://mitindia.in/wp-content/uploads/2021/02/map8.png 1282w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Thanks for scrolling !!!</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fgraphs-in-python%2F&amp;linkname=Graphs%20in%20Python" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fgraphs-in-python%2F&amp;linkname=Graphs%20in%20Python" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fgraphs-in-python%2F&#038;title=Graphs%20in%20Python" data-a2a-url="https://mitindia.in/graphs-in-python/" data-a2a-title="Graphs in Python"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/graphs-in-python/">Graphs in Python</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Data Science &#8211; 4 [extract gold price using web scrap]</title>
		<link>https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Thu, 31 Dec 2020 05:31:11 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[data science]]></category>
		<category><![CDATA[machine learning]]></category>
		<category><![CDATA[webscrap]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1090</guid>

					<description><![CDATA[<p>Extract live gold price using web scrap &#8211; Data Science in the following example we used three packages, they are a) bs4 [Beautiful Soup for web scraping] b) pandas [panel data for data representation ] c) request [to get source / url] #data science with Python - extracting Gold Price import bs4 import pandas as [&#8230;]</p>
<p>The post <a href="https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/">Data Science &#8211; 4 [extract gold price using web scrap]</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Extract live gold price using web scrap &#8211; Data Science</h1>
<p>in the following example we used three packages, they are</p>
<p>a) bs4 [Beautiful Soup for web scraping]<br />
b) pandas [panel data for data representation ]<br />
c) request [to get source / url]</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">#data science with Python - extracting Gold Price
import bs4 
import pandas as pd 
import requests 

url = 'https://www.goodreturns.in/gold-rates/bangalore.html'
result = requests.get(url) 
soup = bs4.BeautifulSoup(result.content,'html.parser') 
price = soup.find_all('div', {"id":"current-price"})
for pr in price:
    print("Price:", pr.text)
txt=pr.text

from tkinter import *
root=Tk()
root.title('Gold Price')
root.configure(bg='gold')
root.geometry('200x100')
w=Label(root, text=txt, bg='red', font='sans 14')
b=Button(root, text="Close", fg='red', bg='yellow', command=root.destroy)
w.pack()
b.pack()
root.mainloop()</pre>
<p><strong>Output of the above example is:</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone  wp-image-1091" src="http://www.mitindia.in/wp-content/uploads/2020/12/goldprice-300x107.png" alt="" width="362" height="129" srcset="https://mitindia.in/wp-content/uploads/2020/12/goldprice-300x107.png 300w, https://mitindia.in/wp-content/uploads/2020/12/goldprice.png 495w" sizes="(max-width: 362px) 100vw, 362px" /></p>
<p><a href="https://www.mitindia.in/data-science-3-web-scraping/">Click here for other programs on Data Science </a></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-4-extract-gold-price-using-web-scrap%2F&amp;linkname=Data%20Science%20%E2%80%93%204%20%5Bextract%20gold%20price%20using%20web%20scrap%5D" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-4-extract-gold-price-using-web-scrap%2F&amp;linkname=Data%20Science%20%E2%80%93%204%20%5Bextract%20gold%20price%20using%20web%20scrap%5D" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fdata-science-4-extract-gold-price-using-web-scrap%2F&#038;title=Data%20Science%20%E2%80%93%204%20%5Bextract%20gold%20price%20using%20web%20scrap%5D" data-a2a-url="https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/" data-a2a-title="Data Science – 4 [extract gold price using web scrap]"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/data-science-4-extract-gold-price-using-web-scrap/">Data Science &#8211; 4 [extract gold price using web scrap]</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Data Science &#8211; 1 [web scraping]</title>
		<link>https://mitindia.in/data-science-1-web-scraping/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sun, 13 Dec 2020 07:58:09 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[data science]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[web scraping]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=1076</guid>

					<description><![CDATA[<p>Data science Data science: is the field of study that combines domain expertise, programming skills, and knowledge of mathematics and statistics to extract meaningful insights from ocean of data. Web scraping can be a solution to speed up the data collection process. Instead of looking at the job site every day, you can use Python [&#8230;]</p>
<p>The post <a href="https://mitindia.in/data-science-1-web-scraping/">Data Science &#8211; 1 [web scraping]</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Data science</h1>
<p><strong>Data science:</strong> is the field of study that combines domain expertise, programming skills, and knowledge of mathematics and statistics to extract meaningful insights from ocean of data.</p>
<p><strong>Web scraping</strong> can be a solution to speed up the data collection process.<br />
Instead of looking at the job site every day, you can use Python to help automate the repetitive parts of your job search.</p>
<ol>
<li>Web scraping example using Python [extract title, head and h1 text from a website]</li>
</ol>
<pre class="EnlighterJSRAW" data-enlighter-language="null">from bs4 import BeautifulSoup
import requests
url = "https://flipkart.com"
req = requests.get(url)
soup = BeautifulSoup(req.text, "lxml") #lxml=html/xml html.parser
print(soup.title)
print(soup.head)
print(soup.h1)

file1=open('test.txt', 'w')
file1.write(str(soup.h1))
file1.close()</pre>
<p>Output of the above program is :</p>
<p><img loading="lazy" decoding="async" class="wp-image-1077 alignleft" src="http://www.mitindia.in/wp-content/uploads/2020/12/webscarp-300x40.png" alt="" width="443" height="59" srcset="https://mitindia.in/wp-content/uploads/2020/12/webscarp-300x40.png 300w, https://mitindia.in/wp-content/uploads/2020/12/webscarp-768x103.png 768w, https://mitindia.in/wp-content/uploads/2020/12/webscarp-1024x137.png 1024w, https://mitindia.in/wp-content/uploads/2020/12/webscarp.png 1251w" sizes="(max-width: 443px) 100vw, 443px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>2. Web scrap example [check web scraping is allowed or not, if status code other than 200 then site is not allowed for scraping!]</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">import requests
from bs4 import BeautifulSoup 
r=requests.get("https://www.amazon.in")
print(r.status_code)
</pre>
<p>output:</p>
<blockquote><p>200</p></blockquote>
<p>3. Retrieve live Covid-19 data using web scraping and store in .csv format locally</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">import bs4 
import pandas as pd 
import requests 
url = 'https://www.worldometers.info/coronavirus/country/india/'
result = requests.get(url) 
soup = bs4.BeautifulSoup(result.text,'lxml') 
#search for maincounter-number class 
cases = soup.find_all('div' ,class_= 'maincounter-number') 
# to store data
data = [] 
for i in cases: 
  span = i.find('span') 
  data.append(span.string)
print('Cases', '\tDeaths', '\tRecovered')
print(data, end='\t') 

#dataframe  to visualize
df = pd.DataFrame({"CoronaData": data}) 
#creating coloumns 
df.index = ['TotalCases', ' Deaths', 'Recovered'] 
# storing into Excel 
df.to_csv('Corona_Data.csv')
</pre>
<p>Output of the above code is :</p>
<blockquote><p>[ Cases       /     Deaths / Recovered ]<br />
[&#8216;9,857,380 &#8216;, &#8216;143,055&#8217;, &#8216;9,357,464&#8217;]</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-1-web-scraping%2F&amp;linkname=Data%20Science%20%E2%80%93%201%20%5Bweb%20scraping%5D" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-science-1-web-scraping%2F&amp;linkname=Data%20Science%20%E2%80%93%201%20%5Bweb%20scraping%5D" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fdata-science-1-web-scraping%2F&#038;title=Data%20Science%20%E2%80%93%201%20%5Bweb%20scraping%5D" data-a2a-url="https://mitindia.in/data-science-1-web-scraping/" data-a2a-title="Data Science – 1 [web scraping]"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/data-science-1-web-scraping/">Data Science &#8211; 1 [web scraping]</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
