How do I extract specific text from a web page?

Discussion in 'Mac Programming' started by mistuk, Nov 13, 2008.

  1. mistuk macrumors member

    Joined:
    Dec 15, 2004
    Location:
    Amesbury, UK
    #1
    Hi all,

    I've given myself a little project. I want to record the line stats from my ADSL modem to try and trace a connection problem. I can get the line stats from my ADSL modem via a web page.

    What I need to do is extract values relating to fields such as Upstream speed, Downstream speed, Line Attenuation. etc and store them in a file - preferably with csv.

    I've tried the "Text from Webpage" action in automator, and this gives me output in this form
    Code:
    (
        "ADSL\nParameters\nADSL Mode\t \nModulator\t \nDSP FirmwareVersion\tDMT FwVer: 3.5.18.0_A_TC, HwVer:T14F7_1.0\nDMT Status\tUp\nOperational Mode\tADSL G.Dmt\nUpstream\t448 kbps\nDownstream\t5216 kbps\nNoise Margin (Upstream)\t22.0 db\nNoise Margin (Downstream)\t6.0 db\nAttenuation (Upstream)\t26.5 db\nAttenuation (Downstream)\t49.5 db\n\n\U00a0  "
    )
    but I don't know where to go from here.....

    I'm have a go at learning a language, and thought this might be a fairly easy project to get me started.

    Any suggestions?

    Thanks,

    mistuk
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    Perl or Python would be good options for your project. Heck even Unix shell scripts would probably get the job done. Python would be my choice, but lots of people love Perl. So pick one and just do a Google search there is absolutely tons of information on all of those languages out there.
     

Share This Page