By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,626 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,626 IT Pros & Developers. It's quick & easy.

Getting information from website

P: 4
Hi!

I want to get information from a sports web site (ex:https://www.bwin.com/pt/futebol), and I already tried htmllib and some other stuff.... the problem is that I can get the page's source code but not the same information that I can see in my browser. Particularly, I'm interested in the teams names!
How can I do this! I can open the browser, copy the information to Notepad, save then and then process then with Python... but... I want to get them directly!

Best regards!
Jan 27 '09 #1
Share this Question
Share on Google+
4 Replies


bvdet
Expert Mod 2.5K+
P: 2,851
Since the text does not exist in the source code, there would be no way of directly reading the information.
Jan 27 '09 #2

micmast
100+
P: 144
it appears the main page is running in a frame
https://www.bwin.com/pt/betViewIframe.aspx?SportID=4
Jan 27 '09 #3

P: 4
I'm a newbie in web programming, but since I can see the information in a browser it should exist a way of getting that information... after all, the browser's programmer can!!

Thanks
Jan 28 '09 #4

P: 4
I was wrong! I can view the team's names in the source, but what I'm having(similar to the source but not equal.. ) does not have the team's names...
My code is this:

import urllib
f = urllib.urlopen("https://www.bwin.com/es/betsnew.aspx?SportID=4")
s = f.read()
#print s
f.close()
fich=open('test.txt','w')
fich.write(s)
fich.close()


Thanks
Jan 28 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.