[Tutor] Can't figure out why I'm getting no output??

scurvy scott stopitscurvy at gmail.com
Tue Jan 28 21:45:01 CET 2014


Hey all.. First of all here is my code:

import requests
from bs4 import BeautifulSoup as beautiful


payload = {'username': 'XXXXX', 'password': 'XXXXXX'}
r = requests.post("http://dogehouse.org/index.php?page=login", data=payload)
soup = beautiful(r.text)
confirmed = str(soup.findAll('span',{'class':'confirmed'}))


print "Confirmed account balance" +confirmed[86:98]

I'm running it on Crunchbang/Debian Linux

I'm trying to write a basic scraper that I can use to output my current
account balance from my mining pool in my terminal.
I've tested the code in the regular python interpreter and it all executes
the way it should. But when I attempt to run it using "python whatever.py"
it doesn't give me any output. Any tips would be appreciated. Thanks.

scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140128/028c39b8/attachment.html>


More information about the Tutor mailing list