This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scrap_coronaData(): | |
try: | |
file_name='nCOV'+datetime.now().strftime("%d-%m-%Y")+'.csv' | |
# corona_data=pd.read_html('https://www.worldometers.info/coronavirus/#countries')[0]#,header=None)[0] | |
header = { | |
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", | |
"X-Requested-With": "XMLHttpRequest" | |
} | |
r = requests.get('https://www.worldometers.info/coronavirus/#countries', headers=header, timeout=10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import necessary libraries | |
import pandas as pd | |
import numpy as np | |
import requests | |
from bs4 import BeautifulSoup as bs | |
from datetime import datetime | |
def scrap_covid19_data(): | |
''' function to scrap the COVID19 affected country wise ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scrap_covid19_data(): | |
''' function to scrap the COVID19 affected country wise ''' | |
header = { | |
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36", | |
"X-Requested-With": "XMLHttpRequest" | |
} |
NewerOlder