Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Hi Monks, I am facing an issue with www::mechanize::firefox Click. I am clicking a button but it is hanging there. and it is not processing any next codes. Can you pls check the below codes pls,

use strict; use WWW::Mechanize::Firefox; my url= "**************************************"; my $mech = WWW::Mechanize::Firefox->new(timeout => 2 ); $mech->allow( javascript =>1); $mech->get($url); sleep(3); $mech->click({ xpath => '//span[@class="paginate_button"]' }, { xpath +=> '//*[contains(text(),"2")]' }); #print "First click ok" ; sleep(3); $mech->click({ xpath => '//span[@class="paginate_button"]' }, { xpath +=> '//*[contains(text(),"3")]' }); sleep(3);

Here it is hanging at the first click and not doing any next process. Here it stuck on $mech->click({ xpath => '//span[@class="paginate_button"]' }, { xpath =>  '//*[contains(text(),"2")]' }); and not coming out of that. I tried giving timeout also, but it is not taking. Is there any other way for this? The Url I tried on is  http://psacareers.gtisolutions.co.uk/VacancyPosting/Search?SearchText=&VacancyPostingFramework=&VacancyBusinessArea=&VacancyRegion=&submit=Search.

Thanks In advance Monks.

I just want the script to come out of that first click and do the rest process. Is there any other way to give timeout? I mean in www::Mechanize we can give like $mech->timeout(2); (but in www::mech::firefox I think we cant!)Thanks Monks.


In reply to WWW::Mechanize::Firefox Script Hangs after an Xpath click by Matt™

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (8)
    As of 2014-09-03 03:24 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (35 votes), past polls