summaryrefslogtreecommitdiff
path: root/scraper
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-03-29 05:15:53 -0400
committerlolcat <will@lolcat.ca>2024-03-29 05:15:53 -0400
commit0f39d9c18710b92b6e7ce6b01f52ff6029460134 (patch)
treed17681d36fab219679969af1e8c8a38c7921cdcb /scraper
parentba7ed59dc5b0ad29c704c699947e45bbdaa3884f (diff)
error handling for invalid pagetype
Diffstat (limited to 'scraper')
-rw-r--r--scraper/google.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/scraper/google.php b/scraper/google.php
index 77aaa3c..50bcc22 100644
--- a/scraper/google.php
+++ b/scraper/google.php
@@ -1020,7 +1020,15 @@ class google{
self::is_class
),
"div"
- )[1];
+ );
+
+ if(!isset($description[1])){
+
+ throw new Exception("Google returned an unsupported page format (will fix)");
+ }else{
+
+ $description = $description[1];
+ }
// get date (rare)
$date =