Questions tagged [www-mechanize]

WWW::Mechanize is a Perl module for programmatic web browsing, used for automating interaction with websites.

Features include:

  • All HTTP methods
  • High-level hyperlink and HTML form support, without having to parse HTML yourself
  • SSL support
  • Automatic cookies
  • Custom HTTP headers
  • Automatic handling of redirections
  • Proxies
  • HTTP authentication

Mech supports performing a sequence of page fetches including following links and submitting forms. Each fetched page is parsed and its links and forms are extracted. A link or a form can be selected, form fields can be filled and the next page can be fetched. Mech also stores a history of the URLs you've visited, which can be queried and revisited.

See the home page for complete details.

366 questions
2
votes
1 answer

How to click a button with its value with WWW::Mechanize

I am trying to click a button using a Perl script with the Mechanize module. However, the name and the position of the button always changes, so I want to click it by using its value, but I could not find how to do it. The button is like…
ccca
  • 75
  • 2
  • 11
2
votes
3 answers

How can I get the contents of a followed link in WWW::Mechanize?

This is my last question for this I hope. I am using $mech->follow_link to try to download a file. For some reason though the file saved is just the page I first pull up and not the link I want to follow. Is this the correct way I should download…
shinjuo
  • 20,498
  • 23
  • 73
  • 104
2
votes
2 answers

perl how to find time for http request completion

I have a form to fill and on submit, it will return result. Now, i want to calculate the time taken to fulfill my request ie time when result got displayed-time i clicked submit. I have no idea, how to do so. Please feel free to use any module. I…
Saurabh Shrivastava
  • 1,394
  • 4
  • 21
  • 50
2
votes
1 answer

Facebook status update using WWW::Mechanize

I am trying to update status on facebook using Mechanize.I am able to login using the script but unable to update.I verified the id of form for status update is "u_0_w". But selecting the form_id method says "There is no form with ID "u_0_w"". My…
Arunesh Singh
  • 3,489
  • 18
  • 26
2
votes
1 answer

How to search for text in html-document with Mechanize?

I am using WWW::Mechanize, HTML::TreeBuilder and HTML::Element in my perl-script to navigate through html-Documents. I want to know how to search for an element, that contains a certain string as text. Here is an example of an…
Hubert Schölnast
  • 8,341
  • 9
  • 39
  • 76
2
votes
1 answer

Perl script using WWW::Mechanize to connect to https site just started failing

I have a Perl script that uses WWW::Mechanize to connect to a site over https, and that script just stopped working the other day. The status and error message I get back are 500 and "Can't connect to jobs.illinois.edu:443". The URL I'm trying to…
mepstein
  • 133
  • 2
  • 7
2
votes
1 answer

how to access Google Scholar using Perl

I'm using the code below to try to search Google Scholar from my website and it will work once or twice and then I get the error "Error GETing http://scholar.google.com: Can't connect to scholar.google.com:80 (Permission denied)" - the code I'm…
neemie
  • 83
  • 1
  • 7
2
votes
1 answer

WWW::Mechanize with SSL works but response is slow

I'm using WWW::Mechanize to make an HTTPS connection to a piece of hardware running its own SSLv3-based web server. My code works but the responses to get(), submit() and click() come back slowly, ranging from 6 to 12 seconds. There's a…
MikeU
  • 114
  • 1
  • 8
2
votes
1 answer

How do I get a "clean" clone of a Test::WWW::Mechanize::PSGI object for aggregated tests?

I have a large test suite for Catalyst/PSGI website that takes about 40+ minutes run. I've switched it to use aggregated tests, using Test::Aggregate::Nested, and now it takes about 20+ minutes to run. I've been experimenting with having the test…
Rob
  • 781
  • 5
  • 19
2
votes
2 answers

Unable to parse html tags with perl

I am trying to parse the following link using perl http://www.inc.com/profile/fuhu I am trying to get information like Rank, 2013 Revenue and 2010 Revenue, etc, But when fetch data with perl, I get following and same shows in Page Source Code.
Himanshu
  • 148
  • 1
  • 2
  • 13
2
votes
1 answer

Perl's Mechanize and save_content()

I'm trying to go paperless with all my utility bills, and that means downloading the statements from Suddenlink instead of stuffing the paper ones into a filing cabinet. I've used WWW::Mechanize before and I've liked it (Why did I try to do this…
John O
  • 4,863
  • 8
  • 45
  • 78
2
votes
1 answer

Add the product to cart using WWW::Mechanize - Perl

I'm writing a script that selects a size and adds the product to cart here is where it is http://store.nike.com/us/en_us/pd/free-4-flyknit-running-shoe/pid-1064825/pgid-1481072 use WWW::Mechanize::Firefox; $mech = WWW::Mechanize::Firefox->new(); my…
Brett
  • 65
  • 5
2
votes
1 answer

WWW:Mechanize GET and POST

In Perl WWW:Mechanize would a $mech->get($url) and a $mech->post($url, [ 'field' => "$var"]); command run on the same or separate instances of a page? I'm looking up values of form/field IDs and using them to generate the POST command, but it's…
MicrobicTiger
  • 577
  • 2
  • 5
  • 21
2
votes
1 answer

perl retrieving page details after mechanize::POST

I am trying to gather data from a website. Some anti-patterns make looking finding the right form objects difficult but I have this solved. I am using a post method to get around some javascript acting as a wrapper to submit the form. My problem…
MicrobicTiger
  • 577
  • 2
  • 5
  • 21
2
votes
6 answers

How can I download a file using WWW::Mechanize or any Perl module?

Is there a way in WWW::Mechanize or any Perl module to read on a file after accessing a website. For example, I clicked a button 'Receive', and a file (.txt) will appear containing a message. How will I be able to read the content? Answers are very…
Suezy
  • 1,071
  • 4
  • 13
  • 19