www-mechanize

Website button click - Perl WWW::Mechanize

拥有回忆 提交于 2019-12-11 02:29:23
问题 I try to use the perl script to automate the interaction with a website. I use module WWW::Mechanize to realize my design. But I cannot perform the button click in my perl script by using command as below. $mech->click( $button [, $x, $y] ) $mech->click_button( ... ) It is because this button does not belongs to any form and without name, I can not call or locate this button in my perl script. How can I make it possible to click this button in my perl script like I interact with browser?

Possible to use timeout in WWW::Mechanize on https?

梦想的初衷 提交于 2019-12-08 07:26:42
问题 We have a Perl script which uses WWW::Mechanize to download content from a secured (https) website via our company proxy using POST action in WWW::Mechanize. Sometimes this post action runs for hours for unknown reasons. I want to control this. I checked for timeout but I also read in one of the post in Stackoverflow that it does not work with https websites. Any idea how I can use the timeout mechanism? I want to stop processing that link say after a minute or so to proceed further and not

Perl WWW::Mechanize::Firefox timeout implementation

萝らか妹 提交于 2019-12-08 03:58:08
问题 I am using WWW::Mechanize::Firefox along with MozRepl plugin in Firefox. The code works properly to fetch content from sites by sending them an HTTP GET request. I am going through a list of URLs and sending an HTTP GET Request to each of them. However, if the request hangs on a particular URL, it keeps waiting. Please note that I am referring to cases where a part of the web page content is loaded while some of the content is still pending. It happens in cases where a web page loads a lot of

Possible to use timeout in WWW::Mechanize on https?

浪尽此生 提交于 2019-12-07 20:43:29
We have a Perl script which uses WWW::Mechanize to download content from a secured (https) website via our company proxy using POST action in WWW::Mechanize. Sometimes this post action runs for hours for unknown reasons. I want to control this. I checked for timeout but I also read in one of the post in Stackoverflow that it does not work with https websites. Any idea how I can use the timeout mechanism? I want to stop processing that link say after a minute or so to proceed further and not wait for hours together. Any help would be really appreciated. Use LWPx::ParanoidAgent and mix it into

WWW::Mechanize::Timed https timeout does not work

ε祈祈猫儿з 提交于 2019-12-06 07:18:08
问题 So I've researched to the ends of the internet (at least I think so) about this issue. I'm trying to set an alarm timeout of 60 seconds for a get() but it does not get caught and will run past 60 seconds, also any time the default timeout (180 sec) is reached for the www::mechanized::timed constructor, I get the error below: Use of uninitialized value in addition (+) at /usr/lib/perl5/site_perl/5.10.0/WWW/Mechanize/Timed.pm line 52. code: use WWW::Mechanize::Timed; use HTTP::Cookies; use Try:

How can I add a progress bar to WWW::Mechanize?

半腔热情 提交于 2019-12-05 05:20:12
I have the following code: $mech->get($someurl, ":content_file" => "$i.flv"); So I'm getting the contents of a url and saving it as an flv file. I'd like to print out every second or so how much of the download is remaining. Is there any way to accomplish this in WWW::Mechanize? WWW::Mechanize says that the get method is a "well-behaved" overload of LWP::UserAgent get . Looking at the docs for LWP::UserAgent, you can provide a content_cb key which is called with each chunk of the downloaded file: $mech->get( $someurl, ":content_cb" => \&callback ); sub callback { my( $data, $response, $proto )

WWW::Mechanize::Timed https timeout does not work

℡╲_俬逩灬. 提交于 2019-12-04 13:31:56
So I've researched to the ends of the internet (at least I think so) about this issue. I'm trying to set an alarm timeout of 60 seconds for a get() but it does not get caught and will run past 60 seconds, also any time the default timeout (180 sec) is reached for the www::mechanized::timed constructor, I get the error below: Use of uninitialized value in addition (+) at /usr/lib/perl5/site_perl/5.10.0/WWW/Mechanize/Timed.pm line 52. code: use WWW::Mechanize::Timed; use HTTP::Cookies; use Try::Tiny; my $ua = WWW::Mechanize::Timed->new( autocheck => 0#turning off autocheck becuase any get errors

MySQL server has gone away during crawling in Perl

独自空忆成欢 提交于 2019-12-04 05:26:55
问题 I use WWW::Mechanize library to get the content of URLs and save their data into mysql tables. But when the page's content is too large, it gives this error message: DBD::mysql::st execute failed: MySQL server has gone away at F:\crawling\perl_tests\swc2.pl line 481. For example, it throws this error when I try to extract the content of this page: https://www.e-conomic.com/secure/api1/EconomicWebService.asmx?wsdl I added this code as well, but it still does not work $connection->{max_allowed

How do I download a file with WWW::Mechanize after it submits a form?

自闭症网瘾萝莉.ら 提交于 2019-12-01 19:26:27
I have the code: #!/usr/bin/perl use strict; use WWW::Mechanize; my $url = 'http://divxsubtitles.net/page_subtitleinformation.php?ID=111292'; my $m = WWW::Mechanize->new(autocheck => 1); $m->get($url); $m->form_number(2); $m->click(); my $response = $m->res(); print $m->response->headers->as_string; It submits the download button on the page, but I'm not sure how to download the file which is sent back after the POST. I'm wanting a way to download this with wget if possible. I was thinking that their may be a secret url passed or something? Or will I have to download it with LWP directly from

How do I download a file with WWW::Mechanize after it submits a form?

筅森魡賤 提交于 2019-12-01 17:12:46
问题 I have the code: #!/usr/bin/perl use strict; use WWW::Mechanize; my $url = 'http://divxsubtitles.net/page_subtitleinformation.php?ID=111292'; my $m = WWW::Mechanize->new(autocheck => 1); $m->get($url); $m->form_number(2); $m->click(); my $response = $m->res(); print $m->response->headers->as_string; It submits the download button on the page, but I'm not sure how to download the file which is sent back after the POST. I'm wanting a way to download this with wget if possible. I was thinking