take the price info from a line

Discussion in 'Perl' started by jenson, Sep 9, 2004.

  1. jenson

    jenson Guest

    I use wget to download a web page.
    Now I need to extract the price info from the following line.

    Prev Close:</td><td class="yfnc_tabledata1">4.83</td></tr><tr><td
    class="yfnc_tablehead1" width="48%">Open:</td><td
    class="yfnc_tabledata1">4.85</td></tr><tr><td class="yfnc_tablehead1"
    width="48%">Bid:

    Question:
    1. How can I get a value between 2 pattern within a line? (My intention is
    to get the value 4.83)
    e.g. pattern1 is Prev Close:</td><td
    class="yfnc_tabledata1">
    pattern2 is </td></tr><tr><td
    class="yfnc_tablehead1" width="48%">Open:





    Any help is much appreciated.

    Jenson
     
    jenson, Sep 9, 2004
    #1
    1. Advertising

  2. jenson wrote:
    > I use wget to download a web page.
    > Now I need to extract the price info from the following line.
    >
    > Prev Close:</td><td class="yfnc_tabledata1">4.83</td></tr><tr><td
    > class="yfnc_tablehead1" width="48%">Open:</td><td
    > class="yfnc_tabledata1">4.85</td></tr><tr><td class="yfnc_tablehead1"
    > width="48%">Bid:
    >
    > Question:
    > 1. How can I get a value between 2 pattern within a line? (My intention is
    > to get the value 4.83)


    You can use a module and/or a regular expression.

    perldoc -q "remove HTML"

    perldoc perlrequick

    If you encounter problems, please feel free to post the code you have.
    Don't post it here, though, but at comp.lang.perl.misc.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Sep 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasanth
    Replies:
    0
    Views:
    600
    Vasanth
    Jun 28, 2004
  2. Andrea Williams

    Clear the Render info & change to different info

    Andrea Williams, Oct 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,458
    Ken Dopierala Jr.
    Oct 27, 2004
  3. Frederick Cole

    Syntax for line through a price

    Frederick Cole, Jun 20, 2004, in forum: HTML
    Replies:
    6
    Views:
    1,803
  4. Nandhu
    Replies:
    0
    Views:
    482
    Nandhu
    Dec 4, 2007
  5. Martina
    Replies:
    2
    Views:
    158
    Anno Siegel
    Sep 10, 2005
Loading...

Share This Page