我是iPhone开发的新手,我正在尝试从Google获取访问令牌,当我登录时,我正在获取HTML内容,在HTML内容中我想要获取BinarySecurityToken节点中包含的令牌。
如何在以下HTML内容中获取该内容?
<head>
<title>Working...</title>
</head>
<body>
<form method="POST"
name="hiddenform"
action="http://localhost:26298/LoginSuccess.aspx">
<input type="hidden" name="wa" value="wsignin1.0" />
<input type="hidden" name="wresult"
value="<t:RequestSecurityTokenResponse xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">
<t:Lifetime><wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2013-04-29T11:50:29.895Z</wsu:Created><wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2013-04-29T12:00:29.895Z</wsu:Expires></t:Lifetime><wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"><EndpointReference xmlns="http://www.w3.org/2005/08/addressing"><Address>urn:orin.converse</Address></EndpointReference></wsp:AppliesTo>
<t:RequestedSecurityToken>
<wsse:BinarySecurityToken wsu:Id="uuid:5a48faca-2977-4c10-8cee-d213726f1971" ValueType="http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
aHR0cCUzYSUyZiUyZnNjaGVtYXMubWljcm9zb2Z0LmNvbSUyZndzJTJmMjAwOCUyZjA2JTJmaWRlbnRpdHklMmZjbGFpbXMlMmZyb2xlPVVzZXImaHR0cCUzYSUyZiUyZnNjaGVtYXMueG1sc29hcC5vcmclMmZ3cyUyZjIwMDUlMmYwNSUyZmlkZW50aXR5JTJmY2xhaW1zJTJmZW1haWxhZGRyZXNzPWtyYWoubmFnJTQwZ21haWwuY29tJmh0dHAlM2ElMmYlMmZzY2hlbWFzLnhtbHNvYXAub3JnJTJmd3MlMmYyMDA1JTJmMDUlMmZpZGVudGl0eSUyZmNsYWltcyUyZm5hbWU9TmFnYXJhamFuK0thcnRoaWtleWFuJmh0dHAlM2ElMmYlMmZzY2hlbWFzLnhtbHNvYXAub3JnJTJmd3MlMmYyMDA1JTJmMDUlMmZpZGVudGl0eSUyZmNsYWltcyUyZm5hbWVpZGVudGlmaWVyPWh0dHBzJTNhJTJmJTJmd3d3Lmdvb2dsZS5jb20lMmZhY2NvdW50cyUyZm84JTJmaWQlM2ZpZCUzZEFJdE9hd2szaEtsblhkRzJsVmozX2F4bFJ1TlRVRzBMT09qdDJBayZodHRwJTNhJTJmJTJmc2NoZW1hcy5taWNyb3NvZnQuY29tJTJmYWNjZXNzY29udHJvbHNlcnZpY2UlMmYyMDEwJTJmMDclMmZjbGFpbXMlMmZpZGVudGl0eXByb3ZpZGVyPUdvb2dsZSZBdWRpZW5jZT11cm4lM2FvcmluLmNvbnZlcnNlJkV4cGlyZXNPbj0xMzY3MjM2ODI5Jklzc3Vlcj1odHRwcyUzYSUyZiUyZmNvbnZlcnNlLmFjY2Vzc2NvbnRyb2wud2luZG93cy5uZXQlMmYmSE1BQ1NIQTI1Nj04TjhQVmRFa1U0Q3NXODhnNVF1QVJkV0Q1c0t0dWxkS3RhY2NOaWd0Sjk0JTNk
</wsse:BinarySecurityToken>
</t:RequestedSecurityToken><t:TokenType>http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0</t:TokenType><t:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</t:RequestType><t:KeyType>http://schemas.xmlsoap.org/ws/2005/05/identity/NoProofKey</t:KeyType></t:RequestSecurityTokenResponse>" />
<noscript>
<p>Script is disabled. Click Submit to continue.</p>
<input type="submit" value="Submit" />
</noscript>
</form>
<script language="javascript">window.setTimeout('document.forms[0].submit()', 0);</script>
</body>
有什么想法吗?提前谢谢。
答案 0 :(得分:0)
已经完成......期待。但似乎你使用XML / HTML命名空间,哼。欢呼声。
https://stackoverflow.com/questions/6116827/looking-for-a-good-tutorial-on-nsxmlparser