Flaskでhtmlの文字列をpython側に受け渡し配列に入れるにはどうすればよいのでしょうか
html
1 <form action ="/send" method = "POST"> 2 <input type="text" id="keyword" name="URL"/> 3 <input type="submit" value="ダウンロード"/> 4 </form>
python
1from flask import Flask, render_template 2from pytube import YouTube 3 4app = Flask(__name__) 5 6@app.route('/',methods =['POST','GET']) 7def hello(): 8 html = render_template('index0.html') 9 return html 10 11 yt = YouTube(form) 12 yt.streams.get_by_itag(137).download(r'c:\test') 13 14if __name__ == "__main__": 15 app.run() 16
回答2件
あなたの回答
tips
プレビュー