This is an amazing day for us. Because today we are going to find the IP address of any website by using world-famous programming with Eaglesoft Programmers.
yes you’re right guess.we are going to use python for this purpose.
We have need to performs some steps for this purpose.
- We have a need to sat Python programming environment in our systems.
- Open your Python code editor and write code in your fresh and new file “import socket as s”
- Press enter and write in another line “my_hostname=s.gethostname()”
- In the same way, we move the cursor to another line and type “my_hostname=s.gethostname()”
- For get the name of your system write “print(“Your host name is:” + my_hostname)”
- Now write “my_ip=s.gethostbyname(my_hostname)” this code help you to get IP of your system.
- if you want to see IP your system write “print(“Your ip adress is: “+ my_ip)”
- in next line write ” webhost=”URL” ” in this code you replace your target website with URL .
- Write “web_ip=s.gethostbyname(webhost)”
- Congarulations you are successful to find IP your targeted website now just print it by write “print(“IP adress of “+webhost+ ” is :”+web_ip) “
Here is full source code for find IP address of any website :
import socket as s
my_hostname=s.gethostname()
print(“Your host name is:” + my_hostname)
my_ip=s.gethostbyname(my_hostname)
print(“Your ip adress is: “+ my_ip)
webhost=”google.com”
web_ip=s.gethostbyname(webhost)
print(“IP adress of “+webhost+ ” is :”+web_ip)
in the above method, if you feel any problem then watch the video with full details.
No comments:
Post a Comment