0

Dear expert - I try to use the code as below to get the website htm source and it works. However, I cannot get the result when I visit the website http://reserve.apple.com/WebObjects/ProductReservation.woa/wa/reserveProduct by using code as below. But, I can access this page by using browser properly. Would you give me some hints or tips to fix this problem? Thank you.

#!/usr/bin/perl

use strict;
use warnings;

# create a new browser
use WWW::Mechanize;
my $browser = WWW::Mechanize->new();

# tell it to get the main page

my $sURL = 'http://www.apple.com';

#my $sURL = 'http://reserve.apple.com/WebObjects/ProductReservation.woa/wa/reserveProduct';

$browser->get($sURL);

print $browser->content;

exit(0);
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by chandrashekar
0

You can try by setting the user-agent.

use WWW::Mechanize;
my $mech=WWW::Mechanize->new();
$mech->agent_alias( 'Windows IE 6' );

For more list of user agents try - perldoc WWW::Mechanize
Also see this page for known issues.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.