PHP Mink/Zombie - handling hanging processes after a fatal exception?

前端 未结 2 905
隐瞒了意图╮
隐瞒了意图╮ 2020-12-22 07:46

I\'m using the PHP script with Mink+Zombie driver (install as on nodejs cannot find module 'zombie' with PHP mink) from here: PHP Mink/Zombie - page visit returns st

2条回答
  •  一个人的身影
    2020-12-22 08:20

    First thing to do in order to avoid fatal exceptions is to implement/use methods with proper error handling. You can create a method to check if the element is not null and if it is to throw a custom exception.

    For example in your case findField method will return null if the element is not found, in this case setValue will e used on a non-object resulting in a fatal error.

提交回复
热议问题