0

Can you create an XML for a website that you do not own?

This is the first question came to my mind when I was thinking to do the following demo app:

Let's say there is a Main Page contains 5 Best Students each has a unique URL with the pattern (http://www.URL.com/StudentDetail.aspx?Id=xxx) directing to a Student Detail Page.

In Student Detail Page there are 3 attributes for a Student. (Name,GPA,Major)

The website updates the names every day with new 5 Students and different 5 URLS with the pattern I mentioned above.

enter image description here

So, If I want to parse all the 5 best students to my UIView. What would be the best ideal way to do it? HTML Parsing would be a nightmare for me because the html Main Page code is not well organized. That's why I asked the first question above.

4

1 回答 1

0

虽然有人说你不能在这里使用正则表达式来解析 HTML 页面,但我仍然建议尝试一下。如果您需要简单地提取与您的 pttern 匹配的字符串(例如http://www.URL.com/StudentDetail.aspx?Id=xxx),则正则表达式可能会派上用场。而且您无需担心糟糕的 HTML。

于 2012-08-30T10:38:17.087 回答