PHP Класс PicoFeed\Scraper\CandidateParser

Автор: Frederic Guillot
Наследование: implements PicoFeed\Scraper\ParserInterface
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( string $html ) Constructor.
execute ( ) : string Get the relevant content with the list of potential attributes.
findContentWithArticle ( ) : string Find
tag.
findContentWithBody ( ) : string Find tag.
findContentWithCandidates ( ) : string Find content based on the list of tag candidates.
findNextLink ( ) : string Find link for next page of the article.
shouldRemove ( DomDocument $dom, DomNode $node ) : boolean Return false if the node should not be removed.
stripAttributes ( DomDocument $dom, DOMXPath $xpath ) Remove blacklisted attributes.
stripGarbage ( string $content ) : string Strip useless tags.
stripTags ( DOMXPath $xpath ) Remove blacklisted tags.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( string $html )
$html string

execute() публичный Метод

Get the relevant content with the list of potential attributes.
public execute ( ) : string
Результат string

findContentWithArticle() публичный Метод

Find
tag.
public findContentWithArticle ( ) : string
Результат string

findContentWithBody() публичный Метод

Find tag.
public findContentWithBody ( ) : string
Результат string

findContentWithCandidates() публичный Метод

Find content based on the list of tag candidates.
public findContentWithCandidates ( ) : string
Результат string

shouldRemove() публичный Метод

Return false if the node should not be removed.
public shouldRemove ( DomDocument $dom, DomNode $node ) : boolean
$dom DomDocument
$node DomNode
Результат boolean

stripAttributes() публичный Метод

Remove blacklisted attributes.
public stripAttributes ( DomDocument $dom, DOMXPath $xpath )
$dom DomDocument
$xpath DOMXPath

stripGarbage() публичный Метод

Strip useless tags.
public stripGarbage ( string $content ) : string
$content string
Результат string

stripTags() публичный Метод

Remove blacklisted tags.
public stripTags ( DOMXPath $xpath )
$xpath DOMXPath