What language/s would be suited for this task?

mingsoup

Golden Member
May 17, 2006
1,295
2
81
Poll a web page for a certain div tag or search it for something.

Fire off an email if something is or is not found.
I have a web page server I can use for this or even my home computer.
Also, is there a web community better suited for this type of question?
Thanks

EDIT: Maybe something like Yahoo Pipes or YQL is more suited to this than full blown PHP. I even read a PowerShell way to do this.
EDIT2: Decided on python and BeautifulSoup. Works great.
 
Last edited:

Leros

Lifer
Jul 11, 2004
21,867
7
81
I'd think you could do this in just about any language. Do you already know any languages?
 

mingsoup

Golden Member
May 17, 2006
1,295
2
81
I'd like to do it on an always on machine. Particularly either on a service(Google Apps supports python) or my own web server.

I'm looking to do it with python, as I've been meaning to get a better grip on it anyway.
Could it be done client or server? I need it to poll like say every 10 minutes, then fire off an email. Due to the email, I'd suppose it'd be limited to server side. I need to do more research on a way I could just get a python test bed on my own computer going.
 
Jan 31, 2013
108
0
0
It would take me about 10 minutes or less to code up a native Windows/Linux/OS X application for doing this. You can just query the web pages on your own machine, and use a SMTP server to fire off the emails to your address.
 

fyb3r

Member
Feb 12, 2013
32
0
0
www.anarchyst-it.com
It would take me about 10 minutes or less to code up a native Windows/Linux/OS X application for doing this. You can just query the web pages on your own machine, and use a SMTP server to fire off the emails to your address.

this. and really you can do this in many languages including python. its just going to take effort and elbow grease on your part to search around for the correct functions to use.

:) good luck to ya mate.
 

robtownley

Junior Member
Apr 30, 2013
4
0
0
You could probably use PHP with only a little bit of research, it's so easy to pick up and has lots of useful features built in that would probably mean you don't even have to do that much coding. 1 year and 6 months ago I hadn't even heard of PHP and I started learning with Books from the local library and on the internet and i've managed to make my own website all on my own with what i've learned. It really is a fantastic language for any website related programming, coupled with javascript, jquery and ajax you can do some really amazing things.

Have fun and good luck
 

Net

Golden Member
Aug 30, 2003
1,592
3
81
there are a lot of different ways and languages you can use as mentioned. if you like xpath you can search "xpath <language> find div with id". And contact some web service to send the email or make your own.

You could also use a headless browser and make use of their api for navigating a webpage if your task gets more complicated.

http://phantomjs.org + http://casperjs.org

for a certain div tag in casperjs:

casper.start('http://foo.bar/home', function() {
if (this.exists('#my_super_id')) {
this.echo('found #my_super_id', 'INFO');
} else {
this.echo('#my_super_id not found', 'ERROR');
}
});

http://casperjs.org/api.html

send email in php
Code:
<?php
 $to = "me@my.com";
 $subject = "It works!";
 $body = "Hi,\n\nI found the div id";
 if (mail($to, $subject, $body)) {
   echo("<p>Message successfully sent!</p>");
  } else {
   echo("<p>Message delivery failed...</p>");
  }
 ?>
 
Last edited: