Home  >  Article  >  Backend Development  >  再发 ,抓取1688网页内容

再发 ,抓取1688网页内容

WBOY
WBOYOriginal
2016-06-23 13:09:331797browse

原帖:
http://bbs.csdn.net/topics/391931065
并未解决

请高手指点,要真的能抓到内容才行。


回复讨论(解决方案)

<?php$ch = curl_init();curl_setopt($ch, CURLOPT_URL, 'https://detail.1688.com/offer/520938481930.html?spm=a260k.635.199825914.5.MRicAH');curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36');curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);$content = curl_exec($ch);curl_close($ch);echo $content;

Statement:
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