【发布时间】:2012-02-27 19:13:01
【问题描述】:
我需要从加载的 HTML 页面中获取 URL。这是放置我的 URL 的 HTML 标记
<a class="top_nav_link" id="logout_link" href="https://login.vk.com/?act=logout&hash=29327318c645d49a48&from_host=vk.com&from_protocol=http" onclick="if (!checkEvent(event)) { ge('logout_form').submit(); return false; }">
还有网址:“https://login.vk.com/?act=logout&hash=29327318c645d49a48&from_host=vk.com&from_protocol=http”
哈希可能不同。 如何获取此网址?
【问题讨论】:
-
你能假设 HTML 是正确格式的 XHTML 吗?或者这是任何可能不是格式良好的 XML 结构的旧 HTML?
-
您是否将页面加载到 UIWebView 中?
-
@JimBlackler 不,我已经在 NSString 中使用 ASIHTTPRequest 加载了它
标签: iphone objective-c ios html-parsing