OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

navigate multiple pages in Chrome Console

  • Thread starter Thread starter Adam Dougall
  • Start date Start date
A

Adam Dougall

Guest
I have some code which clicks through a website and downloads some data. But when I try to run it in chrome console, as soon as the browser navigates to the next website, the code halts. How can I fix this?

Code:
document.getElementById("LOB").value="CA"
document.getElementById("LOB_State").value="MI"
document.getElementById("Effective_Range").value="0"
document.getElementById("Effective_Month").value="12"
document.getElementById("Effective_Day").value="1"
document.getElementById("Effective_Year").value="2024"
fillTables()
   
//wait for page to load
    
document.getElementsByName("File")[1].checked = true
document.getElementsByName("submitButton")[0].click()

Code can't get past here because the 'click' causes a new page to load.

Code:
//wait for page to load
    
document.getElementById("downloadbutton").click()
document.getElementsByClassName("buttons")[3].click()
    
//wait for page to load

<p>I have some code which clicks through a website and downloads some data. But when I try to run it in chrome console, as soon as the browser navigates to the next website, the code halts.
How can I fix this?</p>
<pre><code>document.getElementById("LOB").value="CA"
document.getElementById("LOB_State").value="MI"
document.getElementById("Effective_Range").value="0"
document.getElementById("Effective_Month").value="12"
document.getElementById("Effective_Day").value="1"
document.getElementById("Effective_Year").value="2024"
fillTables()

//wait for page to load

document.getElementsByName("File")[1].checked = true
document.getElementsByName("submitButton")[0].click()
</code></pre>
<p>Code can't get past here because the 'click' causes a new page to load.</p>
<pre><code>//wait for page to load

document.getElementById("downloadbutton").click()
document.getElementsByClassName("buttons")[3].click()

//wait for page to load
</code></pre>
 

Latest posts

Top