Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > Projects and Hacks > iPhone > Applications & Development > iPhone Developer Exchange

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-12-2009, 04:16 PM
nigel150
Status: Offline
Trial Member
 
Join Date: Jun 2009
Posts: 1
Rep Power: 0
nigel150 is on a distinguished road
Default Extracting Data from Webview

Hi, I'm fairly new to iphone programing and i have been trying to make a small app to simply load a website in a UIWebView and then extract parts of data into a UITextView below the webview.
I have been trying to use the code line stringByEvaluatingJavascriptFromString, however, i cannot seem to be able to get the data from webview. Below is my .h and .m codes. So far i am able to successfully load the site in the webview, but not extract the code.

Code:
#import <UIKit/UIKit.h>

@interface webappViewController : UIViewController {

	IBOutlet UIWebView *webview;
	IBOutlet UITextView *textview;
	
}

@property(nonatomic, readonly) UIWebView *webview;
@property(nonatomic, retain) UITextView *textview;
@end

#import "webappViewController.h"

@implementation webappViewController

@synthesize webview;
@synthesize textview;

- (void)viewDidLoad {
	NSString *urladdress = @"http://members.iinet.net.au/~siegwart/Untitled-1.html";
	NSURL *url = [NSURL URLWithString:urladdress];
	NSURLRequest *requestobj = [NSURLRequest requestWithURL:url];
	[webview loadRequest:requestobj];
	NSString *mytext = [webview stringByEvaluatingJavaScriptFromString:@"document.documentElement.textContents"];
	textview.text = mytext;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sapphire: Not using XML overrides, freezing when importing all data? theboyk AppleTV 2 02-19-2009 10:44 PM
Running QuickPWN 22-1.exe on Windows Vista - errors unzipping semorgan Quickpwn 8 01-30-2009 08:34 AM
[2.0][PUSH] How will push services affect the amount of transferred data??? qwertzui General 1 07-20-2008 10:40 PM
[Rogers] PRNewswire - Rogers iPhone Price Plans TATANKA 3G General Talk 22 07-01-2008 04:31 PM
Data recovery - Restore backup of old synchronized items jonatj General 4 02-19-2008 09:31 AM



All times are GMT +2. The time now is 02:24 PM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105