forked from aslan/applicant-site
add merge from http://172.17.254.104/aslan/applicant-site/pulls/12
This commit is contained in:
parent
7a585aa3cd
commit
18c4e21d06
|
@ -93,41 +93,42 @@ class PageScrapper
|
||||||
$links = $content->find('a[href]');
|
$links = $content->find('a[href]');
|
||||||
$srclinks = $content->find('img[src]');
|
$srclinks = $content->find('img[src]');
|
||||||
|
|
||||||
|
// $html0 = $this->document->format()->html();
|
||||||
$html0 = $content->html();
|
// dd($html0);
|
||||||
foreach ($links as $k => $link) {
|
// $html0 = $content->find('a[href]')->set;
|
||||||
$href = $link->attr('href');
|
// foreach ($links as $k => $link) {
|
||||||
|
// $href = $link->attr('href');
|
||||||
if (!str_contains($link->attr('href'), "https://")) {
|
//
|
||||||
|
// if (!str_contains($link->attr('href'), "https://")) {
|
||||||
|
//
|
||||||
$tmp = explode('/', rawurldecode($href));
|
//
|
||||||
foreach ( $tmp as $k => $v) {
|
// $tmp = explode('/', rawurldecode($href));
|
||||||
$tmp[$k] = rawurlencode($v);
|
// foreach ( $tmp as $k => $v) {
|
||||||
}
|
// $tmp[$k] = rawurlencode($v);
|
||||||
$href = implode('/', $tmp);
|
// }
|
||||||
|
// $href = implode('/', $tmp);
|
||||||
|
// $newHref = 'https://mkgtu.ru' . $href;
|
||||||
$html0 = str_replace($href, 'https://mkgtu.ru' . $href, $html0);
|
// echo 'https://mkgtu.ru' . $href;
|
||||||
}
|
// echo '<br>';
|
||||||
}
|
// echo '<br>';
|
||||||
foreach ($srclinks as $k => $srclink) {
|
// $html0 = str_replace($href, $newHref, $html0);
|
||||||
$src = $srclink->attr('src');
|
// }
|
||||||
|
// }
|
||||||
if (!str_contains($srclink->attr('src'), "https://")) {
|
// foreach ($srclinks as $k => $srclink) {
|
||||||
|
// $src = $srclink->attr('src');
|
||||||
|
//
|
||||||
$tmp = explode('/', rawurldecode($src));
|
// if (!str_contains($srclink->attr('src'), "https://")) {
|
||||||
foreach ( $tmp as $k => $v) {
|
// $tmp = explode('/', rawurldecode($src));
|
||||||
$tmp[$k] = rawurlencode($v);
|
// foreach ($tmp as $k => $v) {
|
||||||
}
|
// $tmp[$k] = rawurlencode($v);
|
||||||
$src = implode('/', $tmp);
|
// }
|
||||||
|
// $src = implode('/', $tmp);
|
||||||
|
//
|
||||||
$html0 = str_replace($src, 'https://mkgtu.ru' . $src, $html0);
|
//
|
||||||
}
|
// $html0 = str_replace($src, 'https://mkgtu.ru' . $src, $html0);
|
||||||
}
|
// }
|
||||||
str_replace('st yle', 'style', $html0);
|
// }
|
||||||
|
// str_replace('st yle', 'style', $html0);
|
||||||
|
|
||||||
return $html0;
|
return $html0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue