github.com/MontFerret/ferret@v0.18.0/pkg/drivers/cdp/templates/siblings.go (about) 1 package templates 2 3 import ( 4 "github.com/mafredri/cdp/protocol/runtime" 5 6 "github.com/MontFerret/ferret/pkg/drivers/cdp/eval" 7 ) 8 9 const getPreviousElementSibling = "(el) => el.previousElementSibling" 10 const getNextElementSibling = "(el) => el.nextElementSibling" 11 12 func GetPreviousElementSibling(id runtime.RemoteObjectID) *eval.Function { 13 return eval.F(getPreviousElementSibling).WithArgRef(id) 14 } 15 16 func GetNextElementSibling(id runtime.RemoteObjectID) *eval.Function { 17 return eval.F(getNextElementSibling).WithArgRef(id) 18 }