How can i use selenium in my flask api i am trying to make an api which takes url as input and returns the title of that page but its not working
from selenium import webdriver
from flask import Flask
app = Flask(__name__)
@app.route("/try1/<string:url>")
def yt_downloader(url):
path = r"D:\\Chromedriver.exe"
driver = webdriver.Chrome(path)
driver.get(url)
return(driver.title)
if __name__ == "__main__":
app.run(debug=True)