import threading
import json
import eel

from time import gmtime, strftime
from selenium import webdriver

eel.init('web', allowed_extensions=['.js', '.html'])

# SET PATH HERE
chrome_path = r"C:\Users\woute\Desktop\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)

# Make an object
data = {}
data['trees'] = []

@eel.expose
def getAmount():
    # Refresh the page
    driver.get("https://teamtrees.org/")
    
    data['trees'].append([strftime("%H:%M:%S", gmtime()),driver.find_element_by_id("totalTrees").text.replace(',','')])

    # Write data to an JSON file
    with open('web/data/data.json', 'w') as outfile:
        json.dump(data, outfile)

eel.start('index.html')

a652ddccce09572c454b15a88661a971270a328a
<mask token>


@eel.expose
def getAmount():
    driver.get('https://teamtrees.org/')
    data['trees'].append([strftime('%H:%M:%S', gmtime()), driver.
        find_element_by_id('totalTrees').text.replace(',', '')])
    with open('web/data/data.json', 'w') as outfile:
        json.dump(data, outfile)


<mask token>

<mask token>
eel.init('web', allowed_extensions=['.js', '.html'])
<mask token>


@eel.expose
def getAmount():
    driver.get('https://teamtrees.org/')
    data['trees'].append([strftime('%H:%M:%S', gmtime()), driver.
        find_element_by_id('totalTrees').text.replace(',', '')])
    with open('web/data/data.json', 'w') as outfile:
        json.dump(data, outfile)


eel.start('index.html')

<mask token>
eel.init('web', allowed_extensions=['.js', '.html'])
chrome_path = 'C:\\Users\\woute\\Desktop\\chromedriver.exe'
driver = webdriver.Chrome(chrome_path)
data = {}
data['trees'] = []


@eel.expose
def getAmount():
    driver.get('https://teamtrees.org/')
    data['trees'].append([strftime('%H:%M:%S', gmtime()), driver.
        find_element_by_id('totalTrees').text.replace(',', '')])
    with open('web/data/data.json', 'w') as outfile:
        json.dump(data, outfile)


eel.start('index.html')

import threading
import json
import eel
from time import gmtime, strftime
from selenium import webdriver
eel.init('web', allowed_extensions=['.js', '.html'])
chrome_path = 'C:\\Users\\woute\\Desktop\\chromedriver.exe'
driver = webdriver.Chrome(chrome_path)
data = {}
data['trees'] = []


@eel.expose
def getAmount():
    driver.get('https://teamtrees.org/')
    data['trees'].append([strftime('%H:%M:%S', gmtime()), driver.
        find_element_by_id('totalTrees').text.replace(',', '')])
    with open('web/data/data.json', 'w') as outfile:
        json.dump(data, outfile)


eel.start('index.html')

import threading
import json
import eel

from time import gmtime, strftime
from selenium import webdriver

eel.init('web', allowed_extensions=['.js', '.html'])

# SET PATH HERE
chrome_path = r"C:\Users\woute\Desktop\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)

# Make an object
data = {}
data['trees'] = []

@eel.expose
def getAmount():
    # Refresh the page
    driver.get("https://teamtrees.org/")
    
    data['trees'].append([strftime("%H:%M:%S", gmtime()),driver.find_element_by_id("totalTrees").text.replace(',','')])

    # Write data to an JSON file
    with open('web/data/data.json', 'w') as outfile:
        json.dump(data, outfile)

eel.start('index.html')
