Answer the question
In order to leave comments, you need to log in
How to parse pages using PHP (the address of the pages is the same, but the content is different depending on the login entered)?
Briefly the essence:
There is a list of students' credit numbers, which are used to enter the site with their study results. These results should be parsed, combined and presented in a convenient form, on one page.
Now everything in parts:
Answer the question
In order to leave comments, you need to log in
You can log in using curl , for example.
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "a=4&b=7");
$doc = new Zend\Dom\Query($html, 'utf-8');
$links = $doc->execute('ul.menu a');
foreach ($links as $link) {
$url = $link->getAttribute('href');
...
You can parse through this: https://github.com/imangazaliev/didom , easier and faster
1. Authorize and save cookies.
2. file_get_contents(''); or curl output and cut what you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question