Python 发帖单上说我没有';我不提供意见

Python 发帖单上说我没有';我不提供意见,python,forms,python-requests,Python,Forms,Python Requests,我正在尝试发布到此页面上的表单:。我要发布到的表单是(页面底部的信息和参数): print(req.text)提供我粘贴在页面底部的html。它说没有提供任何信息。为什么它不能识别我的数据输入 HTML: 化学协会网络 $(“#fpWindowDiv”).mouseenter(函数(){signalFDOnMouseIn(“fpWindowDiv”);}); || | 警告:您的浏览器似乎已禁用JavaScript。STITCH中的某些功能可能对您不可用 错误。。。 您尚未提供任何输入。 您

我正在尝试发布到此页面上的表单:。我要发布到的表单是(页面底部的信息和参数):

print(req.text)
提供我粘贴在页面底部的html。它说没有提供任何信息。为什么它不能识别我的数据输入

HTML:


化学协会网络
$(“#fpWindowDiv”).mouseenter(函数(){signalFDOnMouseIn(“fpWindowDiv”);});
|| |

警告:您的浏览器似乎已禁用JavaScript。
STITCH中的某些功能可能对您不可用
错误。。。 您尚未提供任何输入。
您的URL已包含GET参数:

stitch_results_url = 'http://stitch.embl.de/cgi/show_network_section.pl?identifier=802634%20802659&additional_network_nodes=0&chemicalmode=10.5&input_query_species=7955&interactive=yes&internal_call=1&limit=10&minprotchem=1&network_flavor=actions&required_score=400&sessionId=0ZKGxMnojGDg&targetmode=proteins&userId=Ri1Zp7hT9L9G'
<form action="/cgi/show_network_section.pl" id='standard_parameters' method='post'>
但是form
action
属性不使用以下参数:

stitch_results_url = 'http://stitch.embl.de/cgi/show_network_section.pl?identifier=802634%20802659&additional_network_nodes=0&chemicalmode=10.5&input_query_species=7955&interactive=yes&internal_call=1&limit=10&minprotchem=1&network_flavor=actions&required_score=400&sessionId=0ZKGxMnojGDg&targetmode=proteins&userId=Ri1Zp7hT9L9G'
<form action="/cgi/show_network_section.pl" id='standard_parameters' method='post'>
如果表单仍然不被接受,则可能是该页面上的JavaScript向表单添加了附加信息,表单要求设置HTTP Referer头,或者站点在cookie或cookie键控会话中存储附加信息

使用a传递网站设置的任何cookie,向添加引用,并使用浏览器开发工具验证是否遗漏了某些帖子字段


例如,我注意到您没有包括
UserId
sessionId
参数。您需要在URL的查询部分中包含所有参数,以供
POST
工作请求使用。

发布所有代码使这一问题很难回答。尽量缩小范围@ᴋᴇʏsᴇʀ:看起来与我很相关。@MartijnPieters在“缩小”步骤之前,是:)请注意,
请求
可以使用
参数
关键字参数来为您进行URL编码。我之所以使用该URL,是因为您已经向网站提供了输入后得到了该URL。我想发布到的表单只会更改显示的输出。因此,当我使用时,网站还没有收到任何输入,它再次说,
没有输入给定的内容
@NiekdeKlein:你发布的表单没有使用该URL;请参阅表单上的
操作
属性。@NiekdeKlein:问题很可能是由于未在帖子中包含
sessionId
UserId
参数引起的。
<form action="/cgi/show_network_section.pl" id='standard_parameters' method='post'>
import requests

stitch_results_url = 'http://stitch.embl.de/cgi/show_network_section.pl'
# the custom limit of the interaction shown
interaction_shown_custom_limit = 400
# parameters for active prediction methods
neighborhood = 'off'
gene_fusion = 'off'
co_occurrence = 'off'
co_expression = 'off'
experiments = 'on'
databases = 'on'
textmining = 'on'
# required confidence score
required_confidence = 'high confidence (700)'

# Input parameters we are going to send
parameters = {
    'channel1': neighborhood,
    'channel2': gene_fusion,
    'channel3': co_occurrence,
    'channel4': co_expression,
    'channel5': experiments,
    'channel6': databases,
    'channel7': textmining,
    'required_score':required_confidence,
    'custom_limit':interaction_shown_custom_limit
}

req = requests.post(stitch_results_url, params=parameters)