from selenium import webdriver
# Replace these URLs with the actual URLs you want to redirect from and to
initial_url = "https://abdulofficiallove.blogspot.com/"
final_url = "https://japnewses.blogspot.com/"
# Initialize the web driver (make sure you have the appropriate driver installed, like ChromeDriver)
driver = webdriver.Chrome()
# Step 1: Redirect to Google
driver.get("https://www.google.com")
# Step 2: Search for the initial URL
search_box = driver.find_element_by_name("q")
search_box.send_keys(initial_url)
search_box.submit()
# Step 3: Click on the search result that corresponds to the initial URL
search_result = driver.find_element_by_partial_link_text(initial_url)
search_result.click()
# Step 4: Redirect to the final URL
driver.get(final_url)
# Close the browser window
driver.quit()