php 如何取得网页原始码

WBOY
Release: 2016-06-23 13:45:52
Original
984 people have browsed it

我想用php抓取 http://ask.csdn.net/ 网页原始码,
不过我写出来後是用虚拟主机伺服器的ip来抓取的,
要怎麽使用客户端的IP来抓取?
我是个php新手,麻烦提供一下范例。


回复讨论(解决方案)

$content = file_get_contents('http://ask.csdn.net/');echo $content;
Copy after login

不会让你抓吧~······

<?phpecho "就不让你抓";?>
Copy after login

不太可能吧。flash 或 js 能解决跨域问题应该可以。

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!