Hi guys, I'm trying to figure out why my code won't output to terminal, but
will run just fine in interpreter.
I'm using python 2.7.3 on Debian Linux/Crunchbang.

Here is my code.

import requests
from bs4 import BeautifulSoup as beautiful
import sys

def dogeScrape(username, password):
    payload = {'username': username, 'password': password}
    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]

dogeScrape("XXXX", "XXXX")

It will output the "confirmed....." part, just not the confirmed variable.
It will output the entire thing in the interpreter.

I initially ran this without being in a function with the username/password
stuff hardcoded to see if the rest of the scraper would run, it still never
output to stdout.

Any help would be appreciated.

Also, as an aside, is there a terminal/command line parsing library someone
could recommend? I've been looking at optparse but maybe some of you will
have other ideas.

thanks a lot,
Scott
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to