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

Alan Gauld alan.gauld at btinternet.com
Wed Jan 29 02:28:07 CET 2014


On 28/01/14 20:45, scurvy scott wrote:

> 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'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.

Can you clarify what you mean by not giving any output?
Does the print statement print "Confirmed account balance"
with no further data? Or does it not even do that?

Does the OS prompt return? or does it just hang?
Are there any error messages, either from Python or from the OS?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list