Reputation: 91
In a browser there's often arrow buttons that go forward and backward in history:
Can these buttons be clicked on via playwright?
There's no elements for them so I was wondering if this is possible...
await navigationObject(page).backButton.click();
Upvotes: 9
Views: 10593
Reputation: 1654
For Node.js:
await page.goBack()
Or
await page.goForward()
For Python:
await page.go_back()
Or
await page.go_forward()
You can find more info here: https://playwright.dev/docs/api/class-page#page-go-back
Upvotes: 17
Reputation: 39
If you are using Camoufox , add enable_cache=True
into launch options.
Upvotes: -1
Reputation: 1756
Try the History API:
window.history.back()
and
window.history.forward()
See: https://developer.mozilla.org/en-US/docs/Web/API/History_API
Upvotes: 1