#=============================================
# 객체 생성
my $cj = HTTP::Cookies->new(file => "cookie_cymarket.txt", autosave => 1);
my $ie = WWW::Mechanize->new( cookie_jar => $cj, agent=>'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET C
LR 1.1.4322)' );
#=============================================
# request
my $res = $ie->request (
POST 'https://cyxso.cyworld.com/login.jsp',
Content => [
email => $id,
passwd => $pass,
safechk => "on",
loginstr => "direct",
],
);
#=============================================
# form을 가져오기
my @webforms = HTML::Form->parse( $res->content, $res->base );
my $form = $webforms[0];
my @inputs = $form->inputs;
# request를 사용한 dynamic parameter sample
use HTTP::Request::Common; # 중요
foreach my $input ( @inputs )
if ( $input->name eq "excel_name" )
{
$params{ $input->name } = $m_transFile2;
}
else
{
$params{ $input->name } = $input->value;
}
}
my $res = $ie->request (
POST 'http://seller.gsestore.co.kr/selling.registerMultiDlvInfoTemp.smp',
Content_Type => 'form-data',
Content => \%params,
);
댓글 없음:
댓글 쓰기