mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-30 06:40:02 +02:00
Error handling in ExplosmBridge
Skip further processing if element was not found to avoid errors
This commit is contained in:
parent
354cea09a7
commit
211c6421f3
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ class ExplosmBridge extends BridgeAbstract
|
||||||
$html = getSimpleHTMLDOM($url);
|
$html = getSimpleHTMLDOM($url);
|
||||||
|
|
||||||
$element = $html->find('[class*=ComicImage]', 0);
|
$element = $html->find('[class*=ComicImage]', 0);
|
||||||
|
if(!$element) {
|
||||||
|
break; // skip, if element was not found
|
||||||
|
}
|
||||||
$date = $element->find('[class^=Author__Right] p', 0)->plaintext;
|
$date = $element->find('[class^=Author__Right] p', 0)->plaintext;
|
||||||
$author = str_replace('by ', '', $element->find('[class^=Author__Right] p', 1)->plaintext);
|
$author = str_replace('by ', '', $element->find('[class^=Author__Right] p', 1)->plaintext);
|
||||||
$image = $element->find('img', 0)->src;
|
$image = $element->find('img', 0)->src;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue