Basic version: just scrape

This commit is contained in:
boyska 2014-05-18 17:30:25 +02:00
commit 8397347d73
3 changed files with 30 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
cred.txt
ve
*.log
.*.swp

23
leggi.py Normal file
View file

@ -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))

3
requirements.txt Normal file
View file

@ -0,0 +1,3 @@
selenium==2.41.0
splinter==0.6.0
wsgiref==0.1.2