简体   繁体   中英

How to extract javascript dynamic data from a web page

In my MAC OS X application, I need to extract, from a web page, numeric values which are regularly updated via a javascript. When I load the url, I get the html source without the values I am looking for. I found in WebKit Programming Guide the following example which, may be, is the solution : [[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlText]]];

Using Interface Builder, I dragged a WebView from the Library into a window but failed to declare the outlet in the controller : IBOutlet WebView *webView;
syntax error : unknown name view WebView

I opened a fresh new project, added webkit framework to the linked libraries and the same error again. As I am new to objective-c I am probably missing something very basic and help will be very much appreciated

You need to "name" the WebView object to "webView" (and upgrade Xcode to 4 if you are still using Interface Builder!). It's in the attributes, Menu Item Identifier (iirc) - probably set to "automatic". Change it to webView

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM