How to clear data from javascript page for iOS?

I am developing a mobile application (compatible with iOS 5.0 and higher) for a website where users can view certain data directly from their landing page. The user can refine the results by selecting specific parameters (for example, location and / or date). They do not offer any web service calls and will not allow us to access their database. Therefore, my only way to collect data is to "scrap" the site directly.

My problem is that I do not know how to make changes that users can make on the site from an http request from the phone. For example, the site below:

enter image description here

can be pulled from the site and saved as a string with the following command

NSString *html = [NSString stringWithContentsOfURL:urlrequest encoding:NSUTF8StringEncoding error:&err];

I can separate the relevant data:

// I decided to add the script function name in case anyone wanted to look for themselves
<script type="text/javascript" language="Javascript">
//<![CDATA[
function loadData(){

var winMsgTitle = "Date: 04/11/2012";

// this is the actual data I'm concerned with:
gLatLong = new GLatLng(31.59019444444444, -110.50655555555555);
tmpMapIcon = new MapIcon("0_0", 21, 15);
marker = createMarker(gLatLong, 0.0, createInfoWinMsg(winMsgTitle, ".00", ".84", "5711", "2012", "", "07:00"), tmpMapIcon);
map.addOverlay(marker);
point = null;marker = null;
gLatLong = new GLatLng(32.2938260182, -110.7896411419);
tmpMapIcon = new MapIcon("0_0", 21, 15);
marker = createMarker(gLatLong, 0.0, createInfoWinMsg(winMsgTitle, ".00", "1.00", "1254", "2012", "", "07:00"), tmpMapIcon);
map.addOverlay(marker);
point = null;marker = null;
gLatLong = new GLatLng(33.5966853633, -112.1744066477);
tmpMapIcon = new MapIcon("0_0", 21, 15);
marker = createMarker(gLatLong, 0.0, createInfoWinMsg(winMsgTitle, ".00", ".70", "256", "2012", "", "07:00"), tmpMapIcon);
map.addOverlay(marker);
point = null;marker = null;

. , , ,

, . : objective-c?

+3
2

, UIWebView .

JavaScript (, jQuery , " " ..).

javascript .

stringByEvaluatingJavaScriptFromString: webview javascript:

[webView stringByEvaluatingJavaScriptFromString:javascript]

javascript - , , javascript. :

NSString *javascript = [NSString stringWithFormat:@"selectRegion(%@)", targetRegion];

javascripts (Safari Web Inspector, Firefox FireBug plugin...), , .

+2

, , - ?

, , , - UIWebView, JavaScript- , .

, , , .
, - - , , , .

" ", , -, .

" ", , , , , , , , , . , , .

0

All Articles