PHP is a server side language which means there is no "clicking" or GUI(usually) straight from the cli. You will need to parse the results. You can do this with the DOM PHP extension. Use https://www.php.net/manual/en/domdocument.loadhtml.php to load the results into a new DOM object, them iterate through the elements until you find your link. Finally, take the link's href and make another curl request with that cookie jar that you are using in order to keep the session active.
$data = array(
"usr" => "myusername",
"pwd" => "mypassword",
"login" =>"login",
"form" => "submit"
);
$ch = curl_init("https://mypage/");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //Untuk redirect absensi goblog
curl_setopt($ch, CURLOPT_POST, true); //POST request absensi ngeselin
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$doc = new DOMDocument();
$doc->loadHTML($result)
foreach ($doc->childNodes as $item)
if(!empty($href = $item->getAttribute('href')))
{
$ch2 = curl_init("https://mypage/my-account");
curl_setopt($ch2, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch2, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
//Your click results
$accountResults = curl_exec($ch2);
}
}