Questions tagged [lwp]

The World-Wide Web library for Perl - LWP is a set of Perl modules which provides a simple and consistent application programming interface (API) to the World-Wide Web.

The main focus of the library is to provide classes and functions that allow you to write WWW clients. The library also contain modules that are of more general use and even classes that help you implement simple HTTP servers.

Most modules in this library provide an object oriented API. The user agent, requests sent and responses received from the WWW server are all represented by objects. This makes a simple and powerful interface to these services. The interface is easy to extend and customize for your own needs.

The main features of the library are:

  • Contains various reusable components (modules) that can be used separately or together.
  • Provides an object oriented model of HTTP-style communication. Within this framework we currently support access to http, https, gopher, ftp, news, file, and mailto resources.
  • Provides a full object oriented interface or a very simple procedural interface.
  • Supports the basic and digest authorization schemes.
  • Supports transparent redirect handling.
  • Supports access through proxy servers.
  • Provides parser for robots.txt files and a framework for constructing robots.
  • Supports parsing of HTML forms. Implements HTTP content negotiation algorithm that can be used both in protocol modules and in server scripts (like CGI scripts).
  • Supports HTTP cookies.
  • Some simple command line clients, for instance lwp-request and lwp-download.

More information on the CPAN website.

365 questions
0
votes
3 answers

Why don't I get a defined value from LWP::UserAgent->new()?

I get this error while using cookie_jar method: Can't call method cookie_jar on an undefined value Here is my code: my $cookie_jar= new HTTP::Cookies; my $ua=new LWP::UserAgent; my %cookies= fetch CGI::Cookie; my…
Sam
0
votes
2 answers

perl get ip of website using lwp or www::mechanize

So I am working on a crawler, and some of the data I want to store about the sites I crawl is their IP address. I'd prefer to do this without having to hit their server again, so is there anyway to get this information from LWP or WWW::Mechanize…
srchulo
  • 5,143
  • 4
  • 43
  • 72
0
votes
1 answer

POST array to LWP: only first entry getting posted

Here's section of code and i am trying to POST whole array using LWP but server is receiving only first row of array(0 index) while others are not getting sent to server, please guide what i am doing wrong $data_post[0] = "text1"; $data_post[1] =…
neo
  • 89
  • 4
  • 11
-1
votes
2 answers

How can I connect to a iPhone web application using Perl?

Is it possible to use Perl's LWP from my Windows PC to scrape contents of iPhone web application? If yes, which parameters I should change or could someone provide example?
Rubin
  • 39
  • 1
  • 5
-1
votes
2 answers

Perl: Need an LWP & HTTP::Request POST code that actually works

I have been scratching my head trying to get LWP and HTTP::Request to actually pass a POST parameter to a web server. The web server can see the fact that the request was a POST transaction, but it is not picking up the passed parameters. I have…
-1
votes
2 answers

Why doesn't my WWW::Mechanize submit a PayPal form work?

Nothing I've tried can get my code to submit correctly. Can anyone else figure this out? #!/usr/bin/perl use WWW::Mechanize; my $user = 'cowsaremyfriends@gmail.com'; my $pass = 'hackswipe'; # Test account; don't worry my $browser =…
Ryan Lester
  • 2,363
  • 7
  • 25
  • 38
-1
votes
1 answer

Using variable for HTTP request headers with Perl

I am trying to write a function to create HTTP requests (POST and GET mostly) in Perl. I am keeping everything generic by using variables so that I don't have to worry about the type of request, the payload, headers, etc, however…
user3270760
  • 1,444
  • 5
  • 23
  • 45
-1
votes
2 answers

Trying to save a page with Unicode Hindi

I am trying to save a page which has Unicode Hindi fonts on it. I have tried several from this site and from other, but nothing seems to work. The error that I am getting is related to wide characters. here is the code I am using: use CGI; use…
-1
votes
1 answer

Using Perl LWP::UserAgent I get a response on port 443 but not from port 8443

I am using LWP::UserAgent to check the response from a server. I get a response from port 443 but I am not able to get any response from port 8443. When I use cURL for Windows I get a response code from both ports. Please help me.
-2
votes
2 answers

can't retrieve content of a webpage with perl's LWP agent

I have a program that can retrieve the content of a specific webpage, but there are some pages where I get an error: Can't get http://www.sitename.com 302 Moved Temporarily at geturl.pl line 30. The site displays fine on a browser. Wonder what I…
-2
votes
2 answers

How to fetch a one table from HTML source file using lwp module?

I'm beginner. I want to know how to fetch one table form the source HTML file using LWP module? Is it possible to use Regex with LWP?
-2
votes
1 answer

How do I get data from a web API?

I'm pretty basic at Perl, and I need to make a project for my university. I want to download data from certain link, it is JSON data, so I know I have to use JSON::Parse module from CPAN. But how to download content of link to my Perl variable?…
-2
votes
1 answer

Fetch a URL 100 times using Perl

The problem I met is that I need to get one URL (I cannot be specific that link exactly, this link is doing request and looks like http://link.com/?name=name&password=password& and etc) And I need to fetch this URL 100 times in a row. I can not do…
-2
votes
2 answers

Many problems with LWP & HTML::Parser

Hello everyone I coded a script to search a string on a webpage but the request doesn't works I don't know why ... website : http://www.matrixx.com/ string to search : solutions code : #!/usr/bin/perl use strict; use IO::Socket; use…
toto
  • 1
-2
votes
2 answers

Perl LWP::UserAgent only reading first line of posted jpg file

I'm sure this has been asked but I could not find a good question to my answer. I've got two scripts, one makes a post using LWP::UserAgent and the other basically receives the data, in this case I'm just looking to write a file. The file does get…
kyle
  • 568
  • 2
  • 10
  • 26
1 2 3
24
25