Jump to content

using curl ... navigating to the *next* page


inosent

Recommended Posts

hi

 

to log in i use this and it works:

 

[syntax=php]

<?

 

$LOGINURL = "https://pacer.login.uscourts.gov/cgi-bin/check-pacer-passwd.pl";

$POSTFIELDS = 'loginid=inXXXX&passwd=mrXXXX&client=&faction=Login&appurl=https%3A%2F%2Fpcl.uscourts.gov%2Fsearch&court_id=';

    $reffer = "https://pacer.login.uscourts.gov/cgi-bin/login.pl?appurl=https://pcl.uscourts.gov/search";

 

$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL,$LOGINURL);

curl_setopt($ch, CURLOPT_USERAGENT, $agent);

    curl_setopt($ch, CURLOPT_POST, 1);

    curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_REFERER, $reffer);

curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);

curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);

    $result = curl_exec ($ch);

 

  // curl_close ($ch);

 

  // curl_close ($ch2);

print $result;

 

 

?>

 

[/syntax]

 

now that i am logged in i dont know how to get to the next page

 

the html in the page above is

 

[syntax=php]

  <label><br>Party Name</label>

    <table style="float:left;border-collapse:collapse;"><tr><td><span class="format"><b>Format:</b> <i>last, first</i></span><span class="field1"><br/>

    <input type='text' name='party' id='party' size='40' onChange='' accesskey='p'></span></td></tr>

    </table>

    <table style="float:left;"><tr><td><p>

<input type="checkbox" name="exact_party" value="exact_party" id="exact_party"><span class="footer">Exact Matches Only</span>

<span class="help">

         <script type="text/javascript">

        var hb11 = new HelpBalloon({

                dataURL: '/help/Party-Name.xml',

cacheRemoteContent: false,

balloonSize: 'tw'

        });

        </script>

</td></tr></table>

 

</span>

  </li>

  <li id='ssn40'>

  <label>Four Digit SSN </label>

      <span class="field1"><input type='text' name='ssn4' id='ssn4' size='4' maxlength='4' onChange=''></span>

<span class="help">

         <script type="text/javascript">

        var hb12 = new HelpBalloon({

                dataURL: '/help/Four-Digit-SSN.xml',

cacheRemoteContent: false,

balloonSize: 'tw',

fixedPosition: HelpBalloon.POS_TOP_RIGHT

        });

        </script>

</span>

  </li>

  <li id='ssn_search'>

  <label>SSN / TIN </label>

    <span class="field1"><input type='text' name='ssn' id='ssn' size='11' onChange='' maxlength='11' accesskey='N'></span>

<span class="help">

         <script type="text/javascript">

        var hb13 = new HelpBalloon({

                dataURL: '/help/SSN-TID.xml',

cacheRemoteContent: false,

balloonSize: 'tw',

fixedPosition: HelpBalloon.POS_TOP_RIGHT

        });

        </script>

</span>

  </li>

  <li class="buttons">

  <input type="checkbox" name="show_title" value="Yes" id="show_title"><span class="footer">Show Case Title</span><br><br>

  <input type="submit" id="submit" value="Search"  alt='Submit Form' />

  <input type='button' id="clear" value="Clear" onclick="Form.reset('range'); removeErrors(); return(false);" alt='Clear Form' />

  </li>

<input type="hidden" name="court_type" id="court_type" value='all' />

<input type="hidden" name="default_form" id="default_form" value='' />

</fieldset>

</div>

</form>

[/syntax]

 

 

when i run my search i get this header info

 

[syntax=php]

https://pcl.uscourts.gov/dquery

POST /dquery HTTP/1.1

Host: pcl.uscourts.gov

User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip, deflate

Connection: keep-alive

Referer: https://pcl.uscourts.gov/search

Cookie: PacerClientCode=""; PacerPref="receipt=Y"; PacerUser="in269601343141601                                83J8nrzpdSw"; PacerSession="qBw72jrb05Dy2O971k1fNXyzgD2op9Kl4VZ08ooclRrg/U3JvzLvbARpQiHzDHH9RoTwGqfQTIItbjxVO9Kz0sI3Aeafdm8d"; default_form="bkb"

Content-Type: application/x-www-form-urlencoded

Content-Length: 237

case_no=&mdl_id=&stitle=&date_filed_start=&date_filed_end=&date_term_start=&date_term_end=&date_dismiss_start=&date_dismiss_end=&date_discharge_start=&date_discharge_end=&party=bennett&ssn4=8165&ssn=&court_type=bk&default_form=bkb

 

 

 

[/syntax]

 

the second link then would be

 

https://          pcl.uscourts.gov/dquery?case_no=&mdl_id=&stitle=&date_filed_start=&date_filed_end=&date_term_start=&date_term_end=&date_dismiss_start=&date_dismiss_end=&date_discharge_start=&date_discharge_end=&party=enett&ssn4=4144&ssn=&court_type=bk&default_form=bkb

 

 

 

 

 

if i enter this link in the browser it takes me to the right page. however i am stuck with how to navigate after the fact in cUrl after the successful login

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.