Use regular expressions to convert html webpage data into Web services

Source: Internet
Author: User
Tags regular expression
This question is very simple, the Bank of China has a page to check the exchange rate of the day (http://www.bank-of-china.com/info/qpindex.shtml), but is the traditional Html format, and it does not provide Xml format or WebService query. If you want other information systems to read the data at any time, it is convenient that the Bank of China provides a WebService interface for you to call. This is also a typical secure WebService application. Unfortunately, the Bank of China did not do this. Can we do it ourselves? Of course, as long as you use a program to analyze its html webpage, you can easily read the data. Text analysis, of course, depends on our "Regular Expression" (haha, in fact, this is the real purpose of writing this program-apply Regular expressions .)
The BOC page is similar:
Date: 2004/09/30 valid period: 2004/10/07
Currency name current remittance purchase price current banknote purchase price selling price benchmark price
1488.1700
1453.1500
1492.6400


HK $105.9700
105.3300
106.2900
106.1100

USD 826.4200
821.4500
828.9000
827.6600

Swiss franc 655.9300
641.1400
659.2200


Singapore dollar 488.7600
477.2600
490.2300


Swedish krone 112.4900
109.8400
112.8300


Danish krone 136.5900
133.3700
137.0000


Norwegian krone 121.9500
119.0800
122.3100


Yen 7.4344
7.3785
7.4717
7.4519

Canadian dollar 650.8000
635.4800
652.7600


Australian $591.9900
578.6400
594.9600


Euro 1019.6400
1010.9600
1022.7000
1019.7000

Mop 103.2200
102.6000

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.