Prerender url and “do something programmatically” before presenting a page

I have an external website I would like to link to from my site. The external website has a duplicate section which can be dismissed by a button click. I do not want my customers to see this duplicate section. Is there any way that I could (using js) preload the site, select this button, and then present the page to my user?

Thanks!