finds the next element matching the 'selector', taking `header` as starting point