Home  >  Article  >  Backend Development  >  curl抓取新浪微博http_code显示302?

curl抓取新浪微博http_code显示302?

WBOY
WBOYOriginal
2016-06-06 20:48:141336browse

通过curl抓取新浪微博内容,但是总获取不到,通过curl_getinfo看到http_code为302,该怎么处理?

回复内容:

通过curl抓取新浪微博内容,但是总获取不到,通过curl_getinfo看到http_code为302,该怎么处理?

原来心里微博需要登陆才能抓取,加上curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);就跳转到登陆页面,问题是还得先登陆才能再抓取

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