javascript - 当前页面获取另一个页面(http://hq.sinajs.cn/list=s_sh000001)的全部数据,有什么方法可以获取?

WBOY
Release: 2016-06-06 20:28:33
Original
1601 people have browsed it

就是我当前的页面需要抓取另一个页面的全部数据(http://hq.sinajs.cn/list=s_sh000001),有什么方法能获得另一个页面的数据吗?

回复内容:

就是我当前的页面需要抓取另一个页面的全部数据(http://hq.sinajs.cn/list=s_sh000001),有什么方法能获得另一个页面的数据吗?

<code>  <script type="text/javascript" src="http://hq.sinajs.cn/list=s_sh000001"></script>
  <script type="text/javascript">
    alert(hq_str_s_sh000001);
  </script></code>
Copy after login

javascript - 当前页面获取另一个页面(http://hq.sinajs.cn/list=s_sh000001)的全部数据,有什么方法可以获取?

file_get_contents()
curl

用JS的话,一楼的方法足够了;
用PHP的话,那么file_get_contents()是最简单粗暴的方式,分分钟数据到手。CURL也可以,不过需要配置好curl的options

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
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!