Find the answer to your Linux question:
Results 1 to 5 of 5
Hi there, wget -O 545065 betting.racingpost.com/horses/cards/card.sd?race_id=545065&r_date=2012-01-09#racingCard=standard&infoTabs=diomed_verdict cat 545065 returns: <script type="text/javascript">/* <![CDATA[ */ window.location = '/horses/cards/card.sd?race_id=545065&r_date=2012-01-09'/* ]]> */</script Why is it not downloading the html please ? Thanks...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    9

    wget not working as expected

    Hi there,

    wget -O 545065 betting.racingpost.com/horses/cards/card.sd?race_id=545065&r_date=2012-01-09#racingCard=standard&infoTabs=diomed_verdict

    cat 545065 returns:

    <script type="text/javascript">/* <![CDATA[ */
    window.location = '/horses/cards/card.sd?race_id=545065&r_date=2012-01-09'/* ]]> */</script

    Why is it not downloading the html please ?

    Thanks

  2. #2
    Linux Newbie
    Join Date
    Dec 2009
    Posts
    241
    It is.
    But it won't run java scripts.

  3. #3
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    If you really want to go further, one could use https://developer.mozilla.org/en/SpiderMonkey
    But dont expect a oneline solution, this is at least a weekend project.
    You must always face the curtain with a bow.

  4. #4
    Just Joined!
    Join Date
    Oct 2008
    Posts
    9
    Is there any way around this ?

  5. #5
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    I have a need to download a webpage semi-regularly in an autonomous fashion, but, like w/your webpage, the content is dynamically generated by Javascript. I've come up with something that works, however, in my case, I'm downloading images drawn on the webpage, not text, so this solution may not appeal to you. But if it does, read on:

    1. download the Pearl Crescent Page Saver add-on for Firefox

    2. configure the add-on (where to save output files, image file format, etc.)

    3. run firefox from the command line, passing it the URL in question, and the PageSaver command line options, saving the page to an image (jpg, e.g.) file

    if running as a script, it is helpful to run a VNC server session and export the firefox window there. in my case, i add another step to the process where I edit the downloaded image using Gimp and some Script Fu that crops it for me, all from the command line, autonomously.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...