2 link in same tab

 from selenium import webdriver

import time

# Specify the URLs
urls = [
    "https://wwp.psmad.com/redirect-zone/9fcb1dda",
    "https://wwpa.aisory.com/redirect-zone/3484c016"
]

# Create a single Google Chrome session (browser window)
driver = webdriver.Chrome()

try:
    # Open each URL in a new tab
    for url in urls:
        driver.execute_script(f"window.open('{url}', '_blank');")

    # Wait for 3 seconds before refreshing the pages
    time.sleep(3)

    # Refresh each tab
    for tab in driver.window_handles:
        driver.switch_to.window(tab)
        driver.refresh()

finally:
    # Close the browser when done
    driver.quit()

AVI.PARADOX..

Welcome to my blog! My name is PARADOX, and I’m thrilled to have you here., From the first “Hello, World!”.As a passionate coder, I find joy in the logic and structure of coding., This blog is more than just a collection of articles. It’s a community for those who love to gain knowledge as much as I do., So whether you’re here to learn something new, share your own knowledge, or just to be part of the community, I’m glad you’re here.

Post a Comment

Previous Post Next Post

Contact Form