开发者

How do I extract the HTML source of a website in my iPhone app?

开发者 https://www.devze.com 2023-03-20 07:17 出处:网络
I\'m using Xcode to build an app to monitor a web page to see if the HTML changes. I want to extract a website\'s HTML source to compare it to the same website\'s HTML source at a later time to see if

I'm using Xcode to build an app to monitor a web page to see if the HTML changes. I want to extract a website's HTML source to compare it to the same website's HTML source at a later time to see if the website has changed. I can't find anything that would allow me to do this.

If it's not possibl开发者_开发问答e to extract the HTML of a site, I need some way to check for changes in the website.


Use NSURLConnection to retrieve the page as an NSData instance, and save it in an ivar (for example). Then retrieve it again into another NSData instance and compare the two instances using NSData isEqualToData:.

0

精彩评论

暂无评论...
验证码 换一张
取 消