Ajax和搜索引擎

时间:2017-11-20 15:30:44

标签: javascript php jquery ajax

有一个网站的动态内容加载http://title24.ru/。网站众多网页之一的示例:http://title24.ru/index/allhyips_en/0-23 使用cURL解析器脚本生成页面的所有内容:

<?php
$___notjson=1;
ini_set('display_errors', 1);
header ('Content-type: text/html; charset=utf-8');

$a = $_SERVER['HTTP_REFERER'];
$ch = curl_init($a);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$ahtml = curl_exec($ch);
curl_close($ch);
require ('phpQuery.php');
$doc = phpQuery::newDocument($ahtml);
$siteurl = $doc->find('#sitename')->text();
$ch = curl_init('https://'.$siteurl.'/');
curl_setopt($ch, CURLOPT_USERAGENT, 'boyah!!!!!');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$titleon = curl_exec($ch);
curl_close($ch);
$doc = phpQuery::newDocument($titleon);
$title = $doc->find('title')->html();
$counttitle = mb_strlen($title, 'utf-8');
//***получаем значения атрибута 'description' - content***
foreach ($doc['meta[name=description]'] as $meta) {
$desc .= pq($meta)->attr('content');
}
$countdesc = mb_strlen($desc, 'utf-8');
//***получаем значения атрибута 'description' - content***
//***получаем значения атрибута 'keywords' - content***
foreach ($doc['meta[name=keywords]'] as $meta) {
$keyw .= pq($meta)->attr('content');
}
$countkeyw = mb_strlen($keyw, 'utf-8');
//***получаем значения атрибута 'keywords' - content***
$internalurls = $doc->find('[href]')->count($internalurls);
$noindexurls = $doc->find('[rel=nofollow]')->count($noindexurls);
$indexurls = $internalurls - $noindexurls;
$ch = curl_init('https://a.pr-cy.ru/'.$siteurl.'/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$ipdnsinfo = curl_exec($ch);
curl_close($ch);
$doc = phpQuery::newDocument($ipdnsinfo);
$ipadress = $doc->find('#ip .content-test')->html();
$countryadress = $doc->find('#ipCountry .content-test')->html();
$howollddomain = $doc->find('#whoisCreationDate .content-test')->html();
$canceldomain = $doc->find('#whoisExpirationDate .content-test')->html();

echo '<div class="infobox3">';
echo '<div class="ramka"><div class="infobox">Заглавие: <span class="infobox20">' .$title .'&nbsp('.$counttitle .' символов)</span><div class="fldel"></div></div>';
echo '<div class="infobox">Описание: <span class="infobox20">' .$desc .'&nbsp('.$countdesc .' символов)</span><div class="fldel"></div></div>';
echo '<div class="infobox">Ключевые фразы: <span class="infobox20">' .$keyw .'&nbsp('.$countkeyw .' символов)</span><div class="fldel"></div></div>';
echo '<div class="infobox">IP adress: <span class="infobox20">' .$ipadress .'</span><div class="fldel"></div></div>';
echo '<div class="infobox">Страна сервер: <span class="infobox20">' .$countryadress .'</span><div class="fldel"></div></div>';
echo '<div class="infobox">Возраст домена: <span class="infobox20">' .$howollddomain .'</span><div class="fldel"></div></div>';
echo '<div class="infobox">Срок окончания: <span class="infobox20">' .$canceldomain .'</span><div class="fldel"></div></div>';
echo '<div class="infobox">Внутренние ссылки: <span class="infobox20">Найдено ' .$internalurls .' ссылок, из которых индексируются ' .$indexurls .'</span><div class="fldel"></div></div></div>';
echo '</div>';
?>

此脚本使用jQuery代码显示在html页面上:

$.get("/php/titledesc.php?param0=valueA&param1=valueB...&paramN=valueM", function arrr (data) {$("#titledescr").html( $(data).html() )});

在块的内容中:

<div id="titledescr"></div>

事实是,搜索引擎没有看到这些内容,因为这些内容不存在,因此 - 它严重影响了网站在SERP中的排名。

呼吁你 因为我不知道如何解决这个问题。如果你有一个现成的解决方案 - 请帮助我。

对不起我的英语,在写这个问题时,我使用了谷歌的翻译服务。 如果你不理解某些事情,请告诉我,我会尝试用不同的方式写一些东西。

1 个答案:

答案 0 :(得分:0)

事实是,现在google看到了dynamic content。如果您不阻止robots.txt中的javascript文件,则抓取工具会看到您的动态内容。

如果您的动态内容出现问题,请查看Google网站管理员工具。它们还提供工具来查看,谷歌如何看到您的页面。

相关问题