March 10th, 2013, 10:26 AM
Join Date: Nov 2012
Time spent in forums: 14 h 30 m 46 sec
Reputation Power: 0
Grabbing next set of results from webpage
I have written a program that pulls results from a webpage and returns it on the screen, however, I would like it to return more than one result, and the different players. Obviously, this would involve some form of loop, probably a for loop. But all it does is return the same name. I would like it to eliminate that result from the selection after processing it.
data = urllib.request.urlopen('http://www.football-league.co.uk/page/DivisionalScorers/0,,10794~20127,00.html')
e = data.read()
m = e.decode('utf8')
splitted_page = m.split('<div class="statistics">')
splitted_page = splitted_page.split('</div>')
splitted_page2 = splitted_page.split('<tr class="rowDark">')
splitted_page2 = splitted_page2.split('</tr>')
splitted_page3 = splitted_page2.split('<td style="text-align:center;">')
splitted_page3 = splitted_page3.split('</td>')
splitted_page4 = splitted_page2.split('<td>')
splitted_page4 = splitted_page4.split('</td>')
splitted_page5 = splitted_page4.split('>')
splitted_page5 = splitted_page5.split('<')
What it is doing is splitting the page up into several parts until all that remains is what I am looking for.
Edit: I'm using python 3
Last edited by noskiw : March 10th, 2013 at 10:34 AM.
Reason: Forgot to mention python 3