0

I want to read html page and wanna edit that HTML page. example:-

There is Textfield=Username

i had inputed the value of textfield=XYZ

Now i want to that some webpage will open in the application and that webpage consist some textfield.

Now i want to read that webpage and search the textfield name username from that webform. and fill that textfield with the value give in the textfield of the application.

I know that by using webview we can read and HTML page. But is it feasible to search the particular word in the HTML page and make some edition in that.

To read HTML:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@\"http://www.apple.com\"]]];

But to search the perticular word and edit the textfield

IS it feasible? IF yes then how?

4

1 回答 1

2

UIWebVIew has 2 method can make it possible :

- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script

You can run a js in the webview to find your text and edit.

- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL

You can download the webpage then add some html string in it to help you.

于 2012-09-21T05:52:11.473 回答