×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using TCL to recover text from a local website

Using TCL to recover text from a local website

Using TCL to recover text from a local website

(OP)
I have a local access point accessible via wifi. It has an accessible Ip Address at 192.168.91.1.
When this address is placed in the address bar of a browser as https://192.168.91.1/api/meters/aggregates a number of text lines appear in the browser.
What I would like to do is to obtain this text using TCL because this text needs to be manipulated to make good sense out of it. I am able to do this with TCL. However, I have no idea how to obtain this text using TCL via an IP address.
Could someone please point me in the right direction?

RE: Using TCL to recover text from a local website

Are you using something like tclcurl to do this?

RE: Using TCL to recover text from a local website

(OP)
Unfortunately, I have never heard of tclcurl before.
I looked on the internet and although it looks complicated it might me what I need.
I am unable to find a download site. Could you provide a link?
I am using Windows 7.

RE: Using TCL to recover text from a local website

(OP)
I think that tclcurl might be too complicated.
I have no experience with the tcl procedure http either.
Would the http procedure resolve and obtain the text on https://192.168.91.1/api/meters/aggregates?

RE: Using TCL to recover text from a local website

If it begins with 192, the site is local to your network.

Have a look at https://wiki.tcl-lang.org/page/An+HTTP+robot+in+Tc...

Basically what that does is to examine the HTML generated to see what the cgi call is. It then posts this to get the results back

RE: Using TCL to recover text from a local website

(OP)
I found another alternative. Found an application called wget.
It can be downloaded from here: https://eternallybored.org/misc/wget/
A manual page can be found here: https://eternallybored.org/misc/wget/1.20.3/wget.h...

Here is the snippet of code I used:
set line [exec wget.exe \
--no-check-certificate \
-q \
-O - \
--connect-timeout=30 \
-t 3 \
https://192.168.91.1/api/meters/aggregates]

This extracts the text from the website. Here I can now obtain the text I require from this website.

Thank you for making me look harder to find a solution.

RE: Using TCL to recover text from a local website

I've only ever used wget on Linux. If you were on Linux, that is what I would have suggested. Didn't know there was a windows version too.

RE: Using TCL to recover text from a local website

(OP)
Yes, works fine.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close