]*?)id="chapterText">#', $content))
{
$content = preg_replace('#
]*?)id="chapterText">#', '', $content);
$content = preg_replace('#<\/div>$#', '', $content);
}
}
}
if(empty($content))
{
$articles = $xpath->query('//*[contains(@class, "content-body")]');
if($articles !== false && count($articles) > 0)
{
foreach($articles as $container)
{
if(method_exists($container, 'saveHTML'))
{
$content .= ' ' . $container->saveHTML();
}
elseif(isset($container->ownerDocument) && method_exists($container->ownerDocument, 'saveHTML'))
{
$content .= ' ' . $container->ownerDocument->saveHTML($container);
}
elseif(isset($container->nodeValue))
{
$content .= ' ' . $container->nodeValue;
}
}
$content = trim($content);
}
}
if(empty($content))
{
$articles = $xpath->query('//*[contains(@class, "cha-tit")]');
if($articles !== false && count($articles) > 0)
{
foreach($articles as $container)
{
if(method_exists($container, 'saveHTML'))
{
$content .= ' ' . $container->saveHTML();
}
elseif(isset($container->ownerDocument) && method_exists($container->ownerDocument, 'saveHTML'))
{
$content .= ' ' . $container->ownerDocument->saveHTML($container);
}
elseif(isset($container->nodeValue))
{
$content .= ' ' . $container->nodeValue;
}
}
$content = trim($content);
}
$articles = $xpath->query('//*[contains(@class, "cha-content")]');
if($articles !== false && count($articles) > 0)
{
foreach($articles as $container)
{
if(method_exists($container, 'saveHTML'))
{
$content .= ' ' . $container->saveHTML();
}
elseif(isset($container->ownerDocument) && method_exists($container->ownerDocument, 'saveHTML'))
{
$content .= ' ' . $container->ownerDocument->saveHTML($container);
}
elseif(isset($container->nodeValue))
{
$content .= ' ' . $container->nodeValue;
}
}
}
}
if(empty($content))
{
$content = $html->find('.reading-content .text-left .cha-words .cha-words', 0);
if($content)
{
$other_ps = $content->find('p');
if(count($other_ps) > 0)
{
$text = '';
foreach($other_ps as $p)
{
$text .= '
' . $p->plaintext . '
';
}
$content = $text;
}
else
{
$content = $content->innertext;
}
$content = trim($content);
}
else
{
if($html->find('.reading-content #content', 0))
{
$content = $html->find('.reading-content #content', 0)->innertext;
}
else
{
$content = $html->find('.reading-content .text-left .cha-content .cha-words', 0);
if($content)
{
$content = $content->innertext;
}
else
{
$content = $html->find('.reading-content .text-left', 0);
if($content)
{
$other_ps = $content->find('p');
if(count($other_ps) > 0)
{
$text = '';
foreach($other_ps as $p)
{
$text .= '
' . $p->plaintext . '
';
}
$content = $text;
}
else
{
if($inner_content = $content->find('#chapter-content', 0))
{
$content = $inner_content->innertext;
}
else
{
if($inner_content = $content->find('.text-left', 0))
{
$content = $inner_content->innertext;
}
else
{
if($inner_content = $content->find('.fr-view', 0))
{
$content = $inner_content->innertext;
}
else
{
$content = $content->innertext;
}
}
}
}
}
}
}
if(!$content)
{
$content = '';
$ps = $html->find('.reading-content .text-left p');
foreach($ps as $p)
{
$content .= '
' . $p->plaintext . '
';
}
}
}
}
$content = preg_replace('#
]*href=["\']https?:\/\/wuxiaworld\.site[^"\']*["\'][^>]*>\s*]*>.*?Wuxia.*?World\.Site.*?<\/p>\s*<\/a>#', '', $content);
$content = str_replace('wuxiaworld.site', '', $content);
$content = str_replace('wuxiaworldsite', '', $content);
if(stristr($content, 'find('//article', 0);
if($artcontent !== false)
{
$content = $artcontent->innertext;
}
}
}
$content = preg_replace('##i', '', $content);
$content = preg_replace('#<\/div>$#', '', $content);
$qtags = array('div', 'iframe', 'script', 'ins', 'h12');
foreach ($qtags as $qtag) {
$regex = '#<\s*' . $qtag . '[^>]*>.*?<\s*\/\s*'. $qtag . '>#msi';
$content = preg_replace($regex, '', $content);
}
$content = preg_replace('#