is there a way to read text from a website without open ie?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

is there a way to read text from a website without open ie?

Post by idiot » Thu Jan 22, 2009 10:30 pm

basically was wanting to have a website store ip adresses on a page and then when i run a macro have it detect my ip adress and see if it matches one that i have on a website i have no code and no idea how to do any of this
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jan 23, 2009 2:44 pm

If it's a basic web page you should just be able to retrieve it with HTTPRequest. This will retrieve the data to a variable which you can then parse.

HTTPRequest will get more tricky if the page is something you need to log into and cookies are required to track the session.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Sun Jan 25, 2009 9:14 pm

ok i get that looked up command very simple but how would i scan my pc with a macro scheduler script like how to get it to look for what my ip adress is?
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Jan 25, 2009 9:40 pm

Try this UNTESTED script that should work to get the IP of your computer.

Code: Select all

Let>RP_WAIT=1
Let>RP_WINDOWMODE=2
RunProgram>cmd /c ipconfig /all >temp.txt
ReadFile>temp.txt,vTempIP
DeleteFile>temp.txt
Position>IP Address,%vTempIP%,1,vStart
Add>vStart,18
MidStr>%vTempIP%,%vStart%,15,vIP
MessageModal>IP address is %vIP%
(Based on XP PRO, Macro Scheduler 11.1)
Last edited by Bob Hansen on Mon Jan 26, 2009 12:31 am, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Jan 25, 2009 9:49 pm

I'm guessing you want the external IP, and not the LAN IP, so this should work:

[code]
Let>HTTP_TIMEOUT=5
HTTPRequest>http://checkip.dyndns.org,,GET,,HTMLResponse
Position>:,HTMLResponse,1,StartPos
Add>StartPos,2
Position>Endpos,1
MidStr>HTMLResponse,StartPos,EndPos,YourIP
MessageModal>YourIP
[/code]

Original discussion here http://www.mjtnet.com/forum/viewtopic.p ... whatismyip

idiot
Macro Veteran
Posts: 152
Joined: Thu Mar 01, 2007 9:21 am

Post by idiot » Sun Jan 25, 2009 11:29 pm

first one for lan didnt work but second one did this is very cool will help me alot thanks
if idiots rule the world then im the king!!!!
i want a free t-shirt give me all of your rep!!!
please give me pro version of macro scheduler and appnavigator!!!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 26, 2009 12:02 am

Here is another one for the external WAN IP:

Code: Select all

HTTPRequest>http://www.ip-adress.com/,temp.txt,GET
ReadFile>temp.txt,vTempIP
Position>My IP address:,%vTempIP%,1,vStart
Add>vStart,15
MidStr>%vTempIP%,%vStart%,15,vIP
StringReplace>%vIP%,<,,vIP
StringReplace>%vIP%,/,,vIP
StringReplace>%vIP%,s,,vIP
StringReplace>%vIP%,p,,vIP
MessageModal>IP address is %vIP%
DeleteFile>temp.txt
First one I submitted for LAN was not tested originally, but it works OK for me now that I can try it.
How does it not work for you? If you cut/paste from forum, did you remove any trailing spaces?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts