문제

I'm trying to log in Bugzill through Perl URI and I was not able to pass "Bugzilla_login=@mentor.com&Bugzilla_password= info.

I need to log in because after that I want to webscrape some data from bugzilla.

my $data = $scraper->scrape(
my $uri=URI->new('http://prdbugzilla.wv.mentorg.com/bugzilla/show_bug.cgi?id=22444')
);

I'm trying to do something like

curl --data "Bugzilla_login=USER&Bugzilla_password=PASSWORD"  http://prdbugzilla.wv.mentorg.com/bugzilla/show_bug.cgi?id=19971
도움이 되었습니까?

해결책

URI just builds a URI object; it doesn't generate an HTTP request. Try LWP::UserAgent and HTTP::Requset instead:

my $req = HTTP::Request->new( POST => 'http://...' );
$req->content('Bugzilla_login=USER&Bugzilla_password=PASSWORD');

Then you can send the request using LWP::UserAgent.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top