при отправке запроса будем подставлять User-Agent и разрешен редирект

This commit is contained in:
Alexander 2024-08-16 14:31:52 +03:00
parent f304814043
commit f7bbcf41a6
2 changed files with 9 additions and 3 deletions

View File

@ -19,7 +19,7 @@ $sites = ContingentManager::getInstance()->getSites($dbNiimko);
$specializations = ContingentManager::getInstance()->getSpecializations($dbNiimko);
$sql = 'SELECT DISTINCT org_id FROM sveden_education_contingent';
$org = $dbOpendata->selectQuery($sql);
// print_r($sites);
print_r($sites);
// print_r($specializations);
// print_r($org);
$orgs = [];
@ -71,9 +71,15 @@ for ($i = $start; $i < count($sites); $i++) {
'max' => 10,
'strict' => true,
'referer' => true,
'allow_directs' => true,
'track_redirects' => true,
'headers' => [
'content-type' => 'text/html;',
'User-Agent' => '
Mozilla/5.0 (X11; Linux x86_64)
AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/124.0.0.0 YaBrowser/24.6.0.0 Safari/537.36
',
'Content-Type' => 'text/html;',
'charset' => 'utf-8'
]
]

View File

@ -21,7 +21,7 @@ final class ContingentManager
{
// select kod as org_id, site from niimko.s_vuzes
// where ootype = 'vuz' and deleted = 'n' and fake = 'n'
$params = ['vuz', 'n', 'n'];
$params = ['vuz', 'n', 'n', 'RU'];
$query = $this->builder->select()
->setTable('s_vuzes')
->setColumns(['org_id' => 'kod', 'site'])