Scraping IDs from two pages behind a login [closed]

So I need some help getting ID’s from page sources. They are tables that contain links.

<table id="running_freeleech" class="items_table">   
    <tr class="colhead">
        <td colspan="2">Currently Running Freeleech</td>
        <td>Ends in</td>
    </tr>
    <tr class="group_torrent row_a">
        <td class="center cats_col">
            <div title="Adventure"class="cats_games tags_adventure windows"></div>
        </td>
    <td>
    <span id="groupplatform">
        <a href="artist.php?artistname=Windows">Windows</a></span> -<a href='page.php?id=696969' title='View File'>(title)                  
    </td>
  </tr>
<a href='page.php?id=12345'>Link</a> <!- This is the ID I need. I can put them into an array for the next step.  -->
</table>
<table>

<!-- First ID I need is in the LINK : example 696969 --->

<!-- The second page I need to grab two IDs ---> 

<table>
    <tbody id="edition_1">
        <tr class="group_torrent" style="font-weight: normal;" id="torrent09876">
            <td>
                <span>[<a href="torrents.phpaction=download&amp;id=NEEDTHISID&amp;authkey=NEEDTHISAUTHKEY&amp;torrent_pass=torrentpass" title="Download">DL</a>FILES<strong class="freeleech_label">Freeleech!</strong>]</a></span>
            </td>
        </tr>
    </tbody>
</table>

I can build the URL with that data and automate it. The problem is that it is a private site and I don’t know how to automate logging in. But I can manually login if that’s how I have to do it. I figure I can use jQuery to search through elements but I need a little push in the right direction.