这是我的示例表单: https://docs.google.com/forms/d/e/1FAIpQLSfVXZ1721ZRrHetp1qUak9T-o-MwKA9G3q01rLAFI2OJhZjUw/viewform
我想用python发送响应,但我不知道如何填写“文本框”,所以我甚至无法启动它。你能帮我吗?
要将数据提交到Google表单,您首先需要将viewform
替换为您网址中的formResponse
。
您将POST
提交到表单回复URL。你需要记住两件事。
URL
。可以通过将form ID
替换为以下内容来找到它:
https://docs.google.com/forms/d/<form_id>/formResponse
(Right Click -> Inspect Elements)
组件。你应该发现一组具有name属性的ss-structure通道对象:
name="entry.<id>"
一个发送响应的简单程序是:
import requests
url ="https://docs.google.com/forms/d/e/1FAIpQLSfVXZ1721ZRrHetp1qUak9T-o-MwKA9G3q01rLAFI2OJhZjUw/formResponse"
data_to_send = 'DATA' # Assign Data to be sent
requests.post(url, {"entry.685250623":data_to_send}) # Found the entry Id viewing your form
希望这能回答你的问题!!!