How do I extract specific text from a web page?

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

  1. mistuk macrumors member

    Dec 15, 2004
    Amesbury, UK
    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
        "ADSL\nParameters\nADSL Mode\t \nModulator\t \nDSP FirmwareVersion\tDMT FwVer:, 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?


  2. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    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