To me it seems you have a set of URLs in a CSV file and you want to visit them one-by-one and take a screenshot when their html renders.

Why involve excel at all? (are your troubles not enough?). A CSV file can be parsed by much simpler methods, for example using Text::CSV, or by a regex.

Secondly, in the above code you do not know where the error occurs. Indeed there is no mention of a line-number in your own code but there is a reference to some Selenium code. OK, that bugs me too - often I am in the same situation where I need to see where my program died. What I would do if I feel lazy is to insert a print "i am here 1\n"; exit(0); (incrementing 1 to 2, to 3 etc. for each line) in between each line after my $driver for a few lines and keep running the program until the message of death arrives. This is lame but hey it cost me 3 minutes (for that simple code) but eventually lead me to the root of it. I could even make a macro in my editor to do all the inserts for me.

There is an easier way though which is to run perl in debug mode. This will tell you exactly where it died: perl -d <program-name> then press c to run it.


In reply to Re: Recover Excel datas by bliako
in thread Recover Excel datas by Perlchaoui

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.