Html Python请求为搜索按钮输入值

Html Python请求为搜索按钮输入值,html,python-3.x,web-scraping,python-requests,Html,Python 3.x,Web Scraping,Python Requests,我有下面的html,我需要输入一些文本值。我正在使用requests模块尝试下面的python代码,但是它并没有按预期工作。有人能帮忙吗 原始html: 希望发布的html: Python代码: 导入请求 r=请求。获取(“https://www.flipkart.com/,verify=False) search=r.find('input',value=“”) search=“移动” 表单={“:搜索} mobile=requests.post(“https://www.flipka

我有下面的html,我需要输入一些文本值。我正在使用requests模块尝试下面的python代码,但是它并没有按预期工作。有人能帮忙吗

原始html:


希望发布的html:


Python代码:

导入请求
r=请求。获取(“https://www.flipkart.com/,verify=False)
search=r.find('input',value=“”)
search=“移动”
表单={“:搜索}
mobile=requests.post(“https://www.flipkart.com/,数据=表格,验证=假)
导入请求
从bs4导入BeautifulSoup
query=str(输入(“要搜索的产品”\n>)
参数={
“q”:查询,
'otracker':'search',
“otracker1”:“搜索”,
“市场”:“FLIPKART”,
“如图所示”:“on”,
“as”:“off”
}
r=请求。获取(“https://www.flipkart.com/search,params=params)
打印(r.url)
soup=BeautifulSoup(r.text'html.parser')
#打印(soup.prettify())