add context cancelation
This commit is contained in:
parent
a49cf9470a
commit
da80521ed1
@ -102,6 +102,11 @@ func Search(ctx context.Context, searchTerm string, opts ...SearchOptions) ([]Re
|
|||||||
sel := e.DOM
|
sel := e.DOM
|
||||||
|
|
||||||
for i := range sel.Nodes {
|
for i := range sel.Nodes {
|
||||||
|
if err := ctx.Err(); err != nil {
|
||||||
|
rErr = err
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
item := sel.Eq(i)
|
item := sel.Eq(i)
|
||||||
|
|
||||||
rDiv := item.Find("div.r")
|
rDiv := item.Find("div.r")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user