Question

I have a small network which includes multiple PCs and projectors. Normally, I am able to see the projector status(running time, lamp life, etc) via browser when i typed in the ip address of particular projector. I am wondering if it is possible to fetch the information of the projectors on the network using a python script. My idea is to create a small tkinter app which will display those projector status when the user request.I must admit that i am being too ambitious as i don't have enough knowledge on network programming. But if any of you can help me out , i will greatly appreciate.

Was it helpful?

Solution

It sort of depends on how complicated the page is. If it's plain text, then something like this should work

import urllib
stats_text = urllib.urlopen('http://ip.of.projector').read()

If you need to parse the returned page at all to extract the values, you might want to look at BeautifulSoup

OTHER TIPS

you can do it several ways, but since you have not given so much information I would recommend going with mechanize or splinter, both work as a browser so you can read what's on the HTML and even fill/submit forms and much more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top