파싱과 프록시 문의드립니다.. 정보
파싱과 프록시 문의드립니다..본문
파싱을 하던 사이트가 있었는데 갑자기 파싱이 안되네요..
소스구조가 달라진 게 아닌걸 보니 아이피 차단을 한것 같습니다..
프록시를 사용하면 될것 같다는 생각이 드는데..
기존 코드에 프록시를 어떻게 적용해야 되는지 모르겠습니다..
------ 기존 코드 中 ------
function get_page($url,$utf8="1",$post="0",$params="")
{
global $ch;
if($post){
curl_setopt($ch, CURLOPT_POST,true);
if($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPGET,false);
}else{
if($params) $url = $url.http_build_query($params);
curl_setopt($ch, CURLOPT_POST,false);
curl_setopt($ch, CURLOPT_HTTPGET,true);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_AUTOREFERER, 120);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookiefile');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookiefile');
$res = curl_exec($ch);
if($utf8) $res = iconv("euckr","utf8",$res);
return $res;
}
---------------------------
위 부분쯤에 적용을 하면 될것 같은데 방법을 잘 모르겠습니다..
혹시 적용할줄 아시는 분 계신가요??
소스구조가 달라진 게 아닌걸 보니 아이피 차단을 한것 같습니다..
프록시를 사용하면 될것 같다는 생각이 드는데..
기존 코드에 프록시를 어떻게 적용해야 되는지 모르겠습니다..
------ 기존 코드 中 ------
function get_page($url,$utf8="1",$post="0",$params="")
{
global $ch;
if($post){
curl_setopt($ch, CURLOPT_POST,true);
if($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_HTTPGET,false);
}else{
if($params) $url = $url.http_build_query($params);
curl_setopt($ch, CURLOPT_POST,false);
curl_setopt($ch, CURLOPT_HTTPGET,true);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_AUTOREFERER, 120);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookiefile');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookiefile');
$res = curl_exec($ch);
if($utf8) $res = iconv("euckr","utf8",$res);
return $res;
}
---------------------------
위 부분쯤에 적용을 하면 될것 같은데 방법을 잘 모르겠습니다..
혹시 적용할줄 아시는 분 계신가요??
( select a.* , ( select sum(co_count) as co_count from g4_qa_choose where mb_id=a.mb_id and bo_table = 'g4_qa' ) as q_co_count from `g4_write_g4_qa` a where wr_parent = '282841' and wr_8 != '' and wr_is_comment = 1 and CONVERT(wr_7, UNSIGNED) >= 5 group by wr_content having max(wr_7) order by CONVERT(wr_7, UNSIGNED) desc limit 3 )
1055 : Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sir.a.wr_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
error file : /15sir/bbs/board.php