I don't see any scenario that results in a "little command line script" to do what you want.
I've only written a few web scrapers, but I have some advice for you. I think you are into a pretty complicated situation. I looked at the page source of the web page you specified. What I see is a whole mess of computer generated java script code. The number you want, the price of gold isn't on that page. The browser runs some java code on that page in order to get the price of gold. Perl cannot run java code. Only browsers can run java code. There is a module WWW::Mechanize::Chrome which would allow Perl to control a Chrome browser. But this gets complicated.
Updated: I made a mistake. The price does indeed appear be within the HTML generated. that means that Java Script is not necessary to see the actual price. Look at the page source yourself to see how I could have missed it! See below posts. Also see another post suggesting a google search for API's.

My advice is to look somewhere else on the Web for the information you desire. Ideally one of the commodity markets has an API to get what you want without involving a browser at all. I am basically assuming that there has got to be a better way to get gold/silver prices than just this one website. I would give you this same advice even if you were paying me to do this for you. Go look some more for other ways. Good luck!


In reply to Re: how do I scrape this web page by Marshall
in thread how do I scrape this web page by Anonymous Monk

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.