Jump to content

CURL Search available date and Click on


the-joker

Recommended Posts

Hello
 
i am trying to code an script php ( Auto Book appointment )

So i Connected with the target website with this Code Source .

 

   <?php

    $ch = curl_init();


    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, 'https://example.com/login/login.php');
    curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);


    $co = curl_exec($ch);


$doc = new DOMDocument();
libxml_use_internal_errors(true);
$doc->loadHTML($co);

$xpath = new DOMXPath($doc);

$val1 = $xpath->query('//input[@name="_sid"]/@value')->item(0)->nodeValue;


echo $val1;


      $field['process'] = 'login';
    $field['_sid'] = $val1;
    $field['email'] = 'email@email.com';
    $field['pwd'] = '123456';

    $datafield = http_build_query($field);

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $datafield);
    curl_setopt($ch, CURLOPT_VERBOSE, true);

    curl_exec($ch);

    curl_setopt($ch, CURLOPT_URL, 'https://example.com/login/myapp.php?id=5454654');
    $cur = curl_exec($ch);

    echo $cur;


    curl_close($ch);


?>

 

Now i have to Search on the Calender an available date and click ON it

Thene Click ON the POP up to confirm the appointement .

So How can i do this action ?

this is a part of Calender :

this 1 st part with FULL dates

<li class="overable initialised">2018-09-14 <a class="full" type="button">08<i>:30</i></a> <a class="full" type="button">08<i>:45</i></a> <a class="full" type="button">09<i>:00</i></a> <a class="full" type="button">09<i>:15</i></a> <a class="full" type="button">09<i>:30</i></a> <a class="full" type="button">09<i>:45</i></a> <a class="full" type="button">10<i>:00</i></a> <a class="full" type="button">10<i>:15</i></a> <a class="full" type="button">10<i>:30</i></a> <a class="full" type="button">10<i>:45</i></a> <a class="full" type="button">11<i>:00</i></a> <a class="full" type="button">11<i>:15</i></a> <a class="full" type="button">11<i>:30</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5094&amp;skey=90f7a8877d1accee20e413dd209ea029&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+11%3A45&amp;issuer_view=tnTUN2fr&quot;)">11<i>:45</i></a> <a class="full" type="button">12<i>:00</i></a> <a class="full" type="button">12<i>:15</i></a> <a class="full" type="button">12<i>:30</i></a> <a class="full" type="button">13<i>:00</i></a> <a class="full" type="button">13<i>:15</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5096&amp;skey=3ab72b245127e591ba1d0db8afd08fb1&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+13%3A30&amp;issuer_view=tnTUN2fr&quot;)">13<i>:30</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5098&amp;skey=dcd416fa984f755cf9e55e503942220d&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+13%3A45&amp;issuer_view=tnTUN2fr&quot;)">13<i>:45</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.51&amp;skey=8f41ad6700c58d4308fb836cc474c6f1&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+14%3A00&amp;issuer_view=tnTUN2fr&quot;)">14<i>:00</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5102&amp;skey=9ff4540d8cdf1fc8f0b22e9786d059dd&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+14%3A15&amp;issuer_view=tnTUN2fr&quot;)">14<i>:15</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5104&amp;skey=3e58332ea1a132cbe2e00a17017ba5d8&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+14%3A30&amp;issuer_view=tnTUN2fr&quot;)">14<i>:30</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5106&amp;skey=c02c797479820694f40edd05dbc98a99&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+14%3A45&amp;issuer_view=tnTUN2fr&quot;)">14<i>:45</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5108&amp;skey=d6d652cbcde371221550cd466d227259&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+15%3A00&amp;issuer_view=tnTUN2fr&quot;)">15<i>:00</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.511&amp;skey=02670bb010e3f9503dcd3df6a5f914a6&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+15%3A15&amp;issuer_view=tnTUN2fr&quot;)">15<i>:15</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5112&amp;skey=b9fd49cfe1dee68f84cad7b941358cb8&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+15%3A30&amp;issuer_view=tnTUN2fr&quot;)">15<i>:30</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5114&amp;skey=c98b90cd33f13068217484b7af669a8e&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+15%3A45&amp;issuer_view=tnTUN2fr&quot;)">15<i>:45</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5116&amp;skey=8c38d3c3353d46958f09734ed1306820&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+16%3A00&amp;issuer_view=tnTUN2fr&quot;)">16<i>:00</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5118&amp;skey=3e6ecdf78f138930b7dd286cb852aade&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-14+16%3A15&amp;issuer_view=tnTUN2fr&quot;)">16<i>:15</i></a></li>

 

This part with  Availble dates :

 

<li class="overable initialised">2018-09-18 <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5155&amp;skey=c51070edf5580d9f244ee811ab3890d8&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-18+08%3A30&amp;issuer_view=tnTUN2fr&quot;)">08<i>:30</i></a> <a class="dispo" type="button" href="javascript:void(0)" onclick="ajaxCall(&quot;ajax_form_status&quot;, &quot;https://example.com/login/action.php?timestamp=1536452615.5285&amp;skey=f7f7bfabe5c772e74dd94d69a9a9de6e&amp;process=multiconfirm&amp;what=take_appointment&amp;fg_id=5274725&amp;result=2018-09-18+16%3A15&amp;issuer_view=tnTUN2fr&quot;)">16<i>:15</i></a></li>

 

thank you for orienting me

I am waiting .

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.