Skip to content

[enhancement] change behavior when extracting target is not found #1

Closed
@sasezaki

Description

@sasezaki

I will change behavior about extracting target is not found.
No longer throw exception.
Because, target is not found is expectable - like db query behavior.

Migration Notes & WARNING

  • this change can't detect that 'false' is supplied by "extracting target is not found" or filters into it.
  • You should check scraping results has not false.
try {
   $scraper->process('//bad_target', 'key', 'html')
   ->scrape($url);
} catch (Exception $e) {}

   $result = $scraper->process('//bad_target', 'key', 'html')
   ->scrape($url);

  if (!isset($result['key'])) {
    var_dump('error!');
  }

ToDo

  • notes to README
  • storing or logging each not found target (NEXT MAJOR VERSION)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions