Skip to content

Commit 87c7fcd

Browse files
added count test per 1m pop.
debug on chromedriver m1 device
1 parent 1e95418 commit 87c7fcd

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"python.pythonPath": "/bin/python3.8"
2+
"python.pythonPath": "/usr/bin/python",
3+
"python.linting.pylintEnabled": true,
4+
"python.linting.enabled": false
35
}

scrapping.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from selenium import webdriver
2-
from BeautifulSoup import BeautifulSoup
2+
from bs4 import BeautifulSoup
33
import pandas as pd
44

5-
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")
5+
# driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")
6+
driver = webdriver.Chrome("/opt/homebrew/bin/chromedriver")

selenium/covid.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
# import pandas as pd
44
from bs4 import BeautifulSoup as bsoup
55
import graph as grcov
6-
import storing as cstore
6+
# import storing as cstore
77
from firebase import firebase
88
import time
99

10-
driver = webdriver.Chrome('/usr/local/bin/chromedriver')
10+
# driver = webdriver.Chrome('/usr/local/bin/chromedriver')
11+
driver = webdriver.Chrome("/opt/homebrew/bin/chromedriver")
1112
driver.get("https://coronavirus.thebaselab.com/")
1213
# review = driver.find_elements_by_class_name("text-left")
1314
bs_obj = bsoup(driver.page_source, 'html.parser')
@@ -43,6 +44,7 @@
4344
"\n\tMortality Rate : ", arr_rows_data[6],
4445
"\n\tRecovery Rate : ", arr_rows_data[7],
4546
"\n\tCases per 1M Pop. : ", arr_rows_data[8],
47+
"\n\tTests per 1M Pop. : ", arr_rows_data[9],
4648
)
4749
print(
4850
"\n\t========================================",
@@ -61,17 +63,21 @@
6163
date_mmddyyyy = time.strftime('%d/%m/%Y')
6264

6365
data = {
64-
'infection': arr_rows_data_store[0],
65-
'active_case': arr_rows_data_store[1],
66-
'deaths': arr_rows_data_store[2],
67-
'recovered': arr_rows_data_store[3],
68-
'mortality_rate': arr_rows_data_store[4],
69-
'recovery_rate': arr_rows_data_store[5],
66+
"cases": arr_rows_data_store[0],
67+
"deaths": arr_rows_data_store[1],
68+
"new_cases": arr_rows_data_store[2],
69+
"new_deaths": arr_rows_data_store[3],
70+
"active_cases": arr_rows_data_store[4],
71+
"recovered": arr_rows_data_store[5],
72+
"mortality_rate": arr_rows_data_store[6],
73+
"recovery_rate": arr_rows_data_store[7],
74+
"cases_per_1_m_pop": arr_rows_data_store[8],
75+
"tests_per_1_m_pop": arr_rows_data_store[9],
7076
'date': date_mmddyyyy,
71-
'time': time_hhmmss
77+
'time': time_hhmmss,
7278

7379
}
74-
firebase = firebase.FirebaseApplication(yourserver)
80+
firebase = firebase.FirebaseApplication('yourserver')
7581
result = firebase.post('/covid/indonesia', data)
7682
print(result)
7783

0 commit comments

Comments
 (0)