Hello,
Can anyone tell me how I can use the pagination function in n8n-nodes-puppeteer?
I am refering to this node: n8n-nodes-puppeteer - npm
p.s: since I am a newbie and don’t even know code so it would be helpful if you can help me out.
Hello,
Can anyone tell me how I can use the pagination function in n8n-nodes-puppeteer?
I am refering to this node: n8n-nodes-puppeteer - npm
p.s: since I am a newbie and don’t even know code so it would be helpful if you can help me out.
You can use the “Loop While Element Exists” option
a.next
, button[aria-label="Next"]
, etc.).This keeps clicking “Next” until that button disappears. Hope this helps mate.
@Abrar_Sami can you give code for this?
Yes sure. Here you go @Rafay_Saleem
{
“nodes”: [
{
“parameters”: {},
“name”: “Start”,
“type”: “n8n-nodes-base.start”,
“typeVersion”: 1,
“position”: [250, 300],
“id”: “1”
},
{
“parameters”: {
“url”: “https://example.com”,
“behavior”: “loopWhileElementExists”,
“selector”: “button[aria-label="Next"]”,
“actions”: [
{
“action”: “getText”,
“selector”: “.item”,
“outputProperty”: “itemTexts”
},
{
“action”: “click”,
“selector”: “button[aria-label="Next"]”
}
],
“noElementsBehavior”: “break”
},
“name”: “Puppeteer Pagination”,
“type”: “n8n-nodes-puppeteer.puppeteer”,
“typeVersion”: 2,
“position”: [500, 300],
“id”: “2”
}
],
“connections”: {
“Start”: {
“main”: [
[
{
“node”: “Puppeteer Pagination”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}