i first apologize how of beginner am, have hit wall after many other hurdles. basis of retrieve value website, modify using variables , print final value. knowledge of classes , objects very minimal. cannot figure out how can take value numtotal function getplays , use later print final. value prints correctly within function need store value later use 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 , patience.
if understand question correctly
final = myclassobject.getplays() print final should need.
Comments
Post a Comment