I would first like to apologize for how much of a beginner I am, however I have hit this wall after many other hurdles. The basis of this is to retrieve a value from a website, modify it using variables and print the final value. My knowledge of classes and objects is very very minimal. I just cannot figure out how I can take the value numTotal from my function getPlays and use it later to print as Final. The value prints correctly from within the function I just need to store that value for later use as a variable.
class GetPlaycount(object):
def getPlays(self):
print "Working"
browser = webdriver.PhantomJS('C:\Python27\phantomjs-2.0.0-windows\phantomjs.exe')
browser.get('https://osu.ppy.sh/u/4973241')
time.sleep(1)
Plays = browser.find_element_by_xpath('//*[@id="general"]/div[8]').text
numPlays = int(re.sub('[^0-9]', '', Plays))
numTime = int(numPlays) * int(numLength)
numTotal = int(numTime) * float(numVar)
print int(numTotal)
return numTotal
myClassObject = GetPlaycount()
myClassObject.getPlays()
Final = ????
print Final
raw_input("wait")
Thank you for your help and patience.