Python pyFlask正在将我的输入放入我的url浏览器中

Python pyFlask正在将我的输入放入我的url浏览器中,python,html,flask,Python,Html,Flask,简而言之,python Flask是我使用的web托管工作台,我正在尝试创建一个在您的历史记录中没有出现的输入表单 这是我的html表格: 这是处理输入url的python代码: @web_site.route('/home/ViewWindow/ViewWindowResult/',方法=('GET','POST')) def ViewWindowResult(): urlboi=request.values.get('url') response=urllibrequest.urlope

简而言之,python Flask是我使用的web托管工作台,我正在尝试创建一个在您的历史记录中没有出现的输入表单

这是我的html表格:


这是处理输入url的python代码:

@web_site.route('/home/ViewWindow/ViewWindowResult/',方法=('GET','POST'))
def ViewWindowResult():
urlboi=request.values.get('url')
response=urllibrequest.urlopen(url)#将urllib.request导入为urllibrequest
htmlBytes=response.read()
htmlstr=htmlBytes.decode(“utf8”)
返回html(“ViewWindowResult.html”,value=htmlstr)
我的目标是到达这里<代码>/home/ViewWindow/ViewWindow/ViewWindowResult/,
但当我输入“”时,我最终到达了这里<代码>/home/ViewWindow/ViewWindowResult/?url=https%3A%2F%2Fwww.w3schools.com%2Ftags%2F

为什么Flask将我的输入放在url字符串中?我不打算在任何地方这样做。
编辑:您可以通过转到

尝试指定表单方法,如下所示:

<form name="ViewWindow" action="/home/ViewWindow/ViewWindowResult/" method="post">
  <input name="url" type="url" required="required" placeholder="URL Here">
  <input type="submit" value="Go">
</form>

尝试指定表单方法,如下所示:

<form name="ViewWindow" action="/home/ViewWindow/ViewWindowResult/" method="post">
  <input name="url" type="url" required="required" placeholder="URL Here">
  <input type="submit" value="Go">
</form>

使用类似的post方法

    <form name="ViewWindow" action="/home/ViewWindow/ViewWindowResult/" method="post">
  <input name="url" type="url" required="required" placeholder="URL Here">
  <input type="submit" value="Go">
</form
它对我有用,它将打印您输入的url,使用post方法,如

    <form name="ViewWindow" action="/home/ViewWindow/ViewWindowResult/" method="post">
  <input name="url" type="url" required="required" placeholder="URL Here">
  <input type="submit" value="Go">
</form

它对我有用它会打印你输入的url我想我以前做过,但我不小心删除了它,忘了它做了什么。谢谢你的更正!我想我以前是这样做的,但我不小心把它删除了,忘了它是干什么的。谢谢你的更正!