怎样用Java代码抓取动态网页中iframe中的数据?
ringa_lee
ringa_lee 2017-04-17 16:38:56
0
4
405

比如这个页面
http://www.chinamoney.com.cn/fe/Channel/17383?label=2
我想用java获取人民币汇率中间价中的最近一个月的历史数据,要怎么做?

ringa_lee
ringa_lee

ringa_lee

reply all (4)
伊谢尔伦

Actually.
This is what the interface is
http://www.chinamoney.com.cn/fe-c/historyParity.do

    洪涛

    To provide an idea, first use httpClient or URLConnection to obtain web page data, then use htmlPasser to parse the data, and obtain it when encountering an iframe tag.

    The analysis is a little rougher. You can directly use the String function indexOf(String) to get the string between ""... (of course there will be multiple iframes)

      黄舟

      To get the src information of the iframe, just request it directly with httpclient~

        小葫芦

        First get a web page, then get the src addresses of all iframes in the web page, and then get the web content of these addresses. The way to obtain it is to simply send a request using httpclient. In fact, an iframe is also a web page, no different from an ordinary web page

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!