I'm not sure about the logic here.  `i` is defined within this block, but I don't think `html()` will have it in scope.

I think it would be clearer to use a `lambda` here:

    if world.retry_on_exception(lambda: all_pages[i].html):

That way, the lambda that gets created uses the current value of `i`, so `retry_on_exception` is checking the correct index.