I am trying to develop an app that needs to get data from a table on a website, the problem is that I need to get the HTML of the table after the javascript function has run but I've had no success with it so far.
The website is www.mylocalcrime.com. What I currently have the application doing is,
Any ideas would be greatly appreciated.
Thanks
Its really simple. Check out the page code, and you will find a javascript file called "my_local_crime.js". This is the heart of the data you get from the site. When you get to the code lines 164-169 in this document, you get the following javascript code:
var url = "http://api.spotcrime.com/crimes.json?";
url += "lat="+center.lat();
url += "&lon="+center.lng();
url += "&radius="+radius;
url += "&callback=?";
url += "&key=MLC-restricted-key";
This is how the javascript on the page generates the JSON query. You can do the same within objective-c, create the correct query, and get JSON data from api.spotcrime.com instead of going via mylocalcrime.com.
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.