The library has
a search form books. But initially the page has no tag
and InputB with the desired name.

The user writes the title of the book and presses the button. As I understand it, then the script runs that reads the data filled in forms with them in the present form and sends by POST.

Without reloading the page, the user receives search result:

I need to programmatically fill in this form and display the result page. Analyze using the panel Network which data is sent, repeat the request with such parameters, but
does not work.
require 'vendor/autoload.php'; // Connect the Client class use GuzzleHttp\\Client; // Initialize a class to work with remote web resources $client = new Client(); // Do query, get response $response = $client->request("POST", "http://opac.rgub.ru/cgiopac/opacg/opac.exe", [ "form_params" => [ "arg0" => "GUEST", "arg1" => "GUESTE", "TypeAccess" => "FreeAccess", "_errorXsl" => "/opacg/html/common/xsl/error.xsl", "_wait" => "6M", "_xsl" => "/opacg/html/search/xsl/search_results.xsl", "_version" => "2.0.0", The "_service" => "STORAGE:opacfindd:FindView", "outform" => "SHOTFORM", "length" => "15", "query/body" => "%28TI+%CE%E1%EB%EE%EC%EE%E2%29", "query/open" => "{NC:}", "query/close" => "{NC:}", "userId" => "GUEST", "session" => "495180", "iddb" => "5", "level[0]" => "Full", "level[1]" => "Retro" ] ]); // Output the response echo $response->getBody();
What is missing?
UPDNot enough data transferred from
opac.rgub.ru/opacg/guest.html in
opac.rgub.ru/cgiopac/opacg/opac.exe:
"arg0" => "GUEST", "arg1" => "GUESTE", "TypeAccess" => "FreeAccess"
Better. Instead of "Not enough input data. Go back to the search." is displayed with khtml, but on the page nothing is displayed.
Trying to put the title of the first book in the results, nothing is displayed.
// Find the desired of HTML issuance $htmlRGBM = $response->getBody(); $docRGBM = new DOMDocument(); @$docRGBM->loadHTML($htmlRGBM); $xpathRGBM = new DOMXpath($docRGBM); echo $xpathRGBM->query('//entry[1]/text()')[0]->nodeValue;