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
from selenium import webdriver | |
from tabulate import tabulate | |
# setting up driver and loading URL | |
driver = webdriver.Chrome('path/to/chromedriver') | |
driver.get('https://www.worldometers.info/coronavirus/') | |
Country_name = input('Enter Country Name: ') # asking user for country | |
# getting table out |
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
Country_name = input() # taking user input | |
# Finding table cell which contains country name | |
xpath = "//td[contains(text(), '%s')]"% Country_name | |
country_element = table.find_element_by_xpath(xpath) | |
# Finding row that corresponds to that table cell | |
row = country_element.find_element_by_xpath("./..") |
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 webdriver from selenium | |
from selenium import webdriver | |
# create a driver object, send address of chromedriver | |
driver = webdriver.Chrome('path/to/chromedriver') | |
# open url | |
driver.get('https://www.worldometers.info/coronavirus/') |
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 pandas as pd | |
import numpy as np | |
from tqdm import tqdm | |
df = pd.DataFrame(np.random.randint(0, 1000, (100000, 600))) | |
tqdm.pandas(desc="my bar!") | |
df.progress_apply(lambda x: x**2) |
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
from tqdm import trange | |
from time import sleep | |
for i in trange(4, desc='1st loop'): | |
for j in trange(5, desc='2nd loop'): | |
for k in trange(50, desc='3rd loop', leave=False): | |
sleep(0.01) |
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
from tqdm import tqdm | |
from time import sleep | |
for i in tqdm(range(100)): | |
sleep(0.02) |
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
from alive_progress import alive_bar | |
from time import sleep | |
with alive_bar(100) as bar: # default setting | |
for i in range(100): | |
sleep(0.03) | |
bar() # call after consuming one item | |
# using bubble bar and notes spinner | |
with alive_bar(200, bar = 'bubbles', spinner = 'notes2') as bar: |
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
from time import sleep | |
from progressbar import progressbar | |
for i in progressbar(range(100), redirect_stdout=True): | |
print('Some text', i) | |
sleep(0.1) |
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
from time import sleep | |
from progress.bar import Bar | |
with Bar('Processing',max = 5) as bar: | |
for i in range(5): | |
sleep(0.1) | |
print('\n',i) | |
bar.next() |
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
from time import sleep | |
from progressbar import progressbar | |
for i in progressbar(range(100)): | |
sleep(0.02) |