commit 8397347d73b563d442e3a838e38487a95dbea35e Author: boyska Date: Sun May 18 17:30:25 2014 +0200 Basic version: just scrape diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46a07fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +cred.txt +ve +*.log +.*.swp diff --git a/leggi.py b/leggi.py new file mode 100644 index 0000000..735050e --- /dev/null +++ b/leggi.py @@ -0,0 +1,23 @@ +from splinter import Browser + + +def read_pass_file(fname): + with open(fname) as buf: + user = buf.readline().strip() + pwd = buf.readline().strip() + return user, pwd + + +user, password = read_pass_file('cred.txt') + +with Browser('phantomjs') as b: + b.visit('https://www.messagenet.com/') + b.fill('userid', user) + b.fill('password', password) + b.find_by_css('#login button').click() + + b.visit('https://www.messagenet.com/voip/log/?chiamate=ricevute') + rows = b.find_by_css('.log .statusKO') + for r in rows: + cells = r.find_by_tag('td')[1:3] + print '\t'.join(map(lambda c: c.value, cells)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6ef3b8d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +selenium==2.41.0 +splinter==0.6.0 +wsgiref==0.1.2