mirror of
https://github.com/MontFerret/ferret.git
synced 2025-06-27 00:41:09 +02:00
Updated pagination iterator (#338)
* Updated pagination iterator * Added e2e test * Fixed e2e tests
This commit is contained in:
@ -92,16 +92,16 @@ func (i *PagingIterator) Next(ctx context.Context) (core.Value, core.Value, erro
|
||||
return values.ZeroInt, values.ZeroInt, nil
|
||||
}
|
||||
|
||||
clicked, err := i.document.ClickBySelector(ctx, i.selector)
|
||||
if !i.document.ExistsBySelector(ctx, i.selector) {
|
||||
return values.ZeroInt, values.ZeroInt, core.ErrNoMoreData
|
||||
}
|
||||
|
||||
_, err := i.document.ClickBySelector(ctx, i.selector)
|
||||
|
||||
if err != nil {
|
||||
return values.None, values.None, err
|
||||
}
|
||||
|
||||
if clicked {
|
||||
return i.pos, i.pos, nil
|
||||
}
|
||||
|
||||
// terminate
|
||||
return values.None, values.None, nil
|
||||
return i.pos, i.pos, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user