[초보서]님이 남기신 글:
>[초보서]님이 남기신 글:
>
>>-----------------------------------------
>>답변자가 기본적으로 참고할 내용입니다.
>>- 배포판(옵션) : cent os 5.5
>>- 커널버전(옵션)
:
>>- 데몬버전(예:apache
1.3.27) :
>>- 데몬설치유형(RPM/컴파일/기타)
:
>>-----------------------------------------
>>
>>
>>안녕하세요 다름이아니오라
perl의 \\\:Mechanize 의 기능을 쓰기 위해
>>
>>cpan ->
>>install \\\::Mechanize 를 입력하여 모든 옵션을 기본값으로 주고
설치했습니다
>>
>>
>>perl 의 내용중
>>use strict;
>>use warnings;
>>use WWW::Mechanize;
>>
>>my $id = 'your_naver_id';
>>my $passwd = 'your_naver_password';
>>my $reply = 'Check! :)';
>>chomp($reply);
>>
>>my $url = 'http://nid.naver.com/nidlogin.login';
>>my $mech = WWW::Mechanize->new();
>>$mech->get($url);
>>my $res = $mech->submit_form(
>> form_name => 'frmNIDLogin',
>> fields => {
>> id => $id,
>> pw => $passwd
>> },
>>);
>>
>>my $base_url = 'http://cafe.naver.com/AttendanceView.nhn';
>>my @check_urls = (
>> "$base_url?search.clubid=18062050&search.menuid=6", #
>> "$base_url?search.clubid=10586415&search.menuid=108", #
>> );
>>
>>for my $check_url (@check_urls){
>> $mech->get($check_url);
>> $mech->field('content', $reply);
>> $mech->submit();
>>
>>}
>>
>>이렇게 짜고.
>>
>>perl test.pl 로 실행하면
>>[root@localhost ~]# perl test.pl
>>Can't locate WWW/Mechanize.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at test.pl line
3.
>>BEGIN failed--compilation aborted at test.pl line 3.
>>
>>
>>cpan 에 다시 들어가
>>cpan> install \\\::Mechanize
>>CPAN: Storable loaded ok
>>Going to read /root/.cpan/Metadata
>> Database was generated on Tue, 05 Jul 2011 13:42:38 GMT
>>Warning: Cannot install \::Mechanize, don't know what it is.
>>Try the command
>>
>> i /\::Mechanize/
>>
>>to find objects with matching identifiers.
>>
>>입력하면 이렇게 뜨는데 \::Mechanize로 바꺼도 안됩니다
>>
>> 오류가 나는데 어떤 문제인지 모르겠습니다..
조언좀 부탁드립니다~
>
>========================================
>
>
>헉 알파벳인데 WWW 를 \\\로 쳐서 그랬내요 ㅠ.ㅠ;; 인스톨
됩니다
>
>근데 설치후
>
>Test Summary Report
>-------------------
>t/local/click_button.t (Wstat: 0 Tests: 19 Failed: 0)
> TODO passed: 15-17, 19
>t/local/nonascii.t (Wstat: 65280 Tests: 4 Failed: 0)
> Non-zero exit status: 255
> Parse errors: Bad plan. You planned 5 tests but ran 4.
>Files=54, Tests=589, 33 wallclock secs ( 0.24 usr 0.07 sys + 9.92 cusr 0.77 csys
= 11.00 CPU)
>Result: FAIL
>Failed 1/54 test programs. 0/589 subtests failed.
>make: *** [test_dynamic] Error 255
> /usr/bin/make test -- NOT OK
>Running make install
> make test had returned bad status, won't install without force
>
>cpan>
>
>에러가.. 뜨는데
>
>그리고 설치후 다시 perl test.pl 을 실행해보면
마찬가지로
>[root@localhost ~]# perl test2.pl
>Can't locate WWW/Mechanize.pm in @INC (@INC contains:
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at test2.pl
line 3.
>BEGIN failed--compilation aborted at test2.pl line 3.
>이런 오류가 납니다.
>
>
>
>[root@localhost ~]# find / -name *Mechanize*
>/root/.cpan/sources/authors/id/J/JE/JESSE/WWW-Mechanize-1.68.tar.gz
>/root/.cpan/build/WWW-Mechanize-1.68
>/root/.cpan/build/WWW-Mechanize-1.68/lib/WWW/Mechanize
>/root/.cpan/build/WWW-Mechanize-1.68/lib/WWW/Mechanize.pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/man3/WWW::Mechanize::Image.3pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/man3/WWW::Mechanize::FAQ.3pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/man3/WWW::Mechanize.3pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/man3/WWW::Mechanize::Link.3pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/man3/WWW::Mechanize::Examples.3pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/man3/WWW::Mechanize::Cookbook.3pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/lib/WWW/Mechanize
>/root/.cpan/build/WWW-Mechanize-1.68/blib/lib/WWW/Mechanize.pm
>/root/.cpan/build/WWW-Mechanize-1.68/blib/lib/auto/WWW/Mechanize
>/root/.cpan/build/WWW-Mechanize-1.68/blib/arch/auto/WWW/Mechanize
========================================
cpan> install WWW::Mechanize
이렇게 다시한번 시도해 보시고 안되면,
http://search.cpan.org/CPAN/authors/id/J/JE/JESSE/WWW-Mechanize-1.68
.tar.gz
이파일을 다운로드하고
cpan> install WWW-Mechanize-1.68.tar.gz
이렇게 설치해보세요.
여기까지도 안된다면, WWW-Mechanize-1.68.tar.gz 파일을 압축풀고
해당 디렉토리로 이동한 다음에,
역시 root 권한으로
shell> perl Makefile.PL
shell> make
shell> make test
shell> make install
shell> make clean
이렇게 강제로 설치해보세요.
|