Jump to content

Need help to get contents from a webpage into autoit variable


Recommended Posts

Hello,

I am trying to create an AutoIt script that will do some action depending on the contents of a webpage.

The webpage in question will only have the IP address of the computer calling the page. For example, the webpage might simply have this text:

1.1.1.1

Does anyone know how to do this? I need this value to be put into a string variable within AutoIt so that I can tell it what to do. For example, I want to do this:

- go to http://www.mysite.com/WhatIsMyIP/

- Get the response (ip address) into AutoIt variable called "$myIP".

- If $myIP is NOT equal to 1.2.3.4, then display a big popup dialogue box on the computer.

- Else, do nothing.

Does anyone have any suggestions?

Thanks!

Link to comment
Share on other sites

Welcome to the AutoIt Forums ! Posted Image

Try

#include <Inet.au3>

$myIP = _GetIP ( )
MsgBox(0, "IP Address", "Your IP Address is: " & $myIP )
If $myIP <> '1.2.3.4' Then
    SplashTextOn ( "Title", "Wrong IP.", -1, -1, -1, -1, 4, "", 24 )
    Sleep ( 3000 )
    SplashOff ( )
EndIf

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...