-
Notifications
You must be signed in to change notification settings - Fork 0
/
whatismyipaddress.py
32 lines (24 loc) · 1.16 KB
/
whatismyipaddress.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
def get_ip_info_no_screenshot(ip): # Function name reflects the change
# Specify the path to the chromedriver executable
service = Service("C:/chromedriver-win64/chromedriver.exe") # Update this path to your chromedriver location
options = Options()
options.headless = False # Run in non-headless mode (visible browser)
# Initialize the Chrome driver with the service and options
driver = webdriver.Chrome(service=service, options=options)
url = f"https://whatismyipaddress.com/ip/{ip}"
driver.get(url)
# Add a delay to ensure the page loads completely
time.sleep(5)
# No screenshot functionality removed here
print("Page loaded. Press any key to close the browser.")
input() # Wait for user input before closing
driver.quit()
if __name__ == "__main__":
# Removed ip input as there's no screenshot
# ip_address = input("Enter IP address: ")
get_ip_info_no_screenshot("your_ip_address") # Replace with actual IP or remove entirely
print("Browser closed.")