在我开始之前,我可以说,我对用代码与web进行一般性的交流非常陌生。有人能帮我弄到这些参数吗
'a': stMonth,
'b': stDate,
'c': stYear,
'd': enMonth,
'e': enDate,
'f': enYear,
'submit': 'submit'
指的是本页的“设置日期范围”框, http://finance.yahoo.com/q/hp?s=gspc&a=00&b=3&c=1951&d=11&e=29&f=2014&g=d&z=66&y=0
,在我的Python代码中工作。目前包括:
^{pr2}$我相信参数的名称或值可能有问题,但我不能确定。提前感谢-任何和所有的帮助是非常感谢!(包括批评,只要是建设性的!)在
具有
name
属性的<input>
元素等于:{cd3>{cd3>里面有^这个标记:
^{pr2}$它将像常规的
<input>
元素一样向服务器发送名称/值对。 您需要在请求中包含该名称/值对,以便服务器端程序知道您请求数据的股票。在表单中的
submit button
也会向服务器发送一个名称/值对,但这很少重要,在这种情况下,您可以忽略它:{eem>它实际上是由发送到的url:
如果将其复制到浏览器的地址栏中,您将看到结果。
resp.text
是包含结果的页面的html标记。你必须知道如何搜索html来找到特定的结果。要使用python搜索html,请查看:您不需要
submit
参数,但需要一个g
。这里d
表示daily
:例如,如果您调用:
^{pr2}$打印以下内容(日期为第一列):
我想你不需要用params。只需格式化一个URL就足够了。像这样:
相关问题 更多 >
编程相关推荐