Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要以如下形式上传文件(txt):
添加按钮的结构如下:
上传后,我必须使用发送按钮发送文件:
发送按钮的结构如下:
我搜索并发现只有这样的例子:
browser.select_form(name = 'formForm') browser.form.add_file(open(directory)) response = browser.submit()
但是我没有成功,如果有人可以帮助我,非常感谢
这就是你要找的:
br.form.add_file(open(filename), 'text/plain', filename)