mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-22 01:25:28 +03:00
parent
d08b2616ef
commit
39a8346c53
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ final class PokemonNewsBridge extends BridgeAbstract
|
|||
// todo: parse json api instead: https://www.pokemon.com/api/1/us/news/get-news.json
|
||||
$url = 'https://www.pokemon.com/us/pokemon-news';
|
||||
$dom = getSimpleHTMLDOM($url);
|
||||
|
||||
$haystack = (string)$dom;
|
||||
if (str_contains($haystack, 'Request unsuccessful. Incapsula incident')) {
|
||||
throw new \Exception('Blocked by anti-bot');
|
||||
}
|
||||
foreach ($dom->find('.news-list ul li') as $item) {
|
||||
$title = $item->find('h3', 0)->plaintext;
|
||||
$description = $item->find('p.hidden-mobile', 0);
|
||||
|
|
Loading…
Reference in a new issue