simulating a headless browser behavior.