{"action":"opened","issue":{"url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2696","repository_url":"https://api.github.com/repos/GoogleChrome/puppeteer","labels_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2696/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2696/comments","events_url":"https://api.github.com/repos/GoogleChrome/puppeteer/issues/2696/events","html_url":"https://github.com/GoogleChrome/puppeteer/issues/2696","id":330238457,"node_id":"MDU6SXNzdWUzMzAyMzg0NTc=","number":2696,"title":"How to handle unknown multiple redirections after form post? ","user":{"login":"vivsriv19","id":14215016,"node_id":"MDQ6VXNlcjE0MjE1MDE2","avatar_url":"https://avatars2.githubusercontent.com/u/14215016?v=4","gravatar_id":"","url":"https://api.github.com/users/vivsriv19","html_url":"https://github.com/vivsriv19","followers_url":"https://api.github.com/users/vivsriv19/followers","following_url":"https://api.github.com/users/vivsriv19/following{/other_user}","gists_url":"https://api.github.com/users/vivsriv19/gists{/gist_id}","starred_url":"https://api.github.com/users/vivsriv19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivsriv19/subscriptions","organizations_url":"https://api.github.com/users/vivsriv19/orgs","repos_url":"https://api.github.com/users/vivsriv19/repos","events_url":"https://api.github.com/users/vivsriv19/events{/privacy}","received_events_url":"https://api.github.com/users/vivsriv19/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-07T11:52:20Z","updated_at":"2018-06-07T11:52:20Z","closed_at":null,"author_association":"NONE","body":"I am trying to open a page after a form post inside evaluate. There are 2 redirections after form post which can be any number and then I find a final page.\r\n\r\nI tried to handled it by putting below (2 times for 2 redirections) after evaluate in which form post happened.\r\n\r\n```\r\nawait page.waitForNavigation({'waitUntil':'domcontentloaded'});\r\nawait page.waitForNavigation({'waitUntil':'domcontentloaded'});\r\n```\r\n\r\nThe above worked properly but I have to handle the situations when any number of redirections can happen.\r\n\r\nI won't have any specific selector on DOM as page might be different many times.\r\n\r\n* Puppeteer version: 1.4.0\r\n* Platform / OS version: Linux\r\n* URLs (if applicable): NA\r\n* Node.js version: 8.10.0\r\n\r\nThe below is part of code which I am using :-  \r\n....\r\n```\r\nconst formPost = await page.evaluate((a) => {\r\n\t\r\n\t              var form = formBuilder(\"payment_post\", \"post\", acsUrl);                \r\n\t              for (var i in a) {\r\n\t              \tform.add(i, i, 'hidden', a[i]);\r\n\t              }\r\n\t              form.generate(\"pareqFormContainer\");\r\n\t              form.submit();\r\n\t              return  document.querySelector('#pareqFormContainer').innerHTML;\r\n\t                                \t\t  \r\n\t    \t\t}, jsonData)\r\n\t    \t.then(function () {\r\n\t            logger.info(\"form submitted with pareq and MD for txnId : \" + jsonData.txnId)\r\n\t        });\t\t    \t  \r\n\t    \t\r\n\t    \tawait page.waitForNavigation({'waitUntil':'domcontentloaded','timeout': waitTimeOut});\r\nawait page.waitForNavigation({'waitUntil':'domcontentloaded','timeout': waitTimeOut});\r\n```\r\n...\r\n\r\n\r\n"}}
{"actor":{"display_login":"vivsriv19"}}