我正在尝试访问此网站的数据:
URL = ('https://www.optionsxpress.com.au/'
'OXNetTools/Chains/index.aspx?Chai'
'nType=3&SessionID=C73763A1C9E747C'
'DBDB18D0276D6B780')
数据由调用和放置分隔,由单选按钮访问。我已尝试使用以下请求提供表单数据:
data='{"args":{"symbol":"SPY","range":"4","exp":"3/20/2015;1","currentimpvol":"14.08","stockpricedisplay":"205.83","daystillexp":"27","interestrate":"1.00","txtPricerDividendDate":"12/19/2014","txtPricerDividend":"1.13","lstPricerDivFreq":"91","includediv":"false","isdetached":"0","callput":"P","sessionid":"C73763A1C9E747CDBDB18D0276D6B780"}}'
r = requests.get(URL, params=data, allow_redirects=False)
但它只返回调用,例如默认的url / response。
我已经能够使用selenium的webdriver来做到这一点,但我想知道如何在没有selenium的情况下做到这一点,理想情况下使用urllib2和标准库。