Updates for scraper errors, still erroring sometimes though.

This commit is contained in:
Dan Chadwick
2024-09-21 10:53:38 -04:00
parent 57da5fed63
commit 41d0d557fb
3 changed files with 9 additions and 4 deletions

View File

@@ -174,8 +174,8 @@ class FighterImporter {
/* $cid = "ufc:" . $url; */
$request = $this->httpClient->request('GET', $url, $headers);
$content = $request->getBody()->getContents();
$check = strpos($content, "No Result Found For");
if (!$check) {
$invalid_page = strpos($content, "No Result Found For");
if (!$invalid_page) {
\Drupal::logger('ufc')->notice("Extracting fighters from page $i.");
self::extractFighters($content);
continue;