hieunekodesu
New Member
this is my code
Python:
from selenium import webdriver
from selenium.webdriver.common.by import By
from flask import Flask, jsonify, render_template, request
import time
url = "https://lichess.org/oW6O03Np/black"
driver = webdriver.Chrome()
driver.get(url)
stages = driver.find_element(By.XPATH, """//*[@id="main-wrap"]/main/div[1]/div[6]/div[2]""")
app = Flask(__name__)
@app.route('/_stuff', methods = ['GET'])
def stuff():
# return jsonify(result=time.time())
return jsonify(result="".join(stages.text.split('\n')))
@app.route('/')
def index():
return render_template('timer.html')
if __name__ == '__main__':
app.run()