python + web

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2006
Posts: 4
Reputation: Uncle_John is an unknown quantity at this point 
Solved Threads: 0
Uncle_John Uncle_John is offline Offline
Newbie Poster

python + web

 
0
  #1
Mar 19th, 2008
hey,

is it possible to make a python program that could interact with internet, for example
a program that could make a search on google. If it is possible then how could i do that?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 42
Reputation: 1337455 10534 is an unknown quantity at this point 
Solved Threads: 7
1337455 10534 1337455 10534 is offline Offline
Light Poster

Re: python + web

 
0
  #2
Mar 19th, 2008
A web browser is better suited for such, but please search the global module index, there will be something in there for you.
"And da wind cry moron." ~ Pearls Before Swine
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 14
Reputation: StepIre is an unknown quantity at this point 
Solved Threads: 1
StepIre StepIre is offline Offline
Newbie Poster

Re: python + web

 
0
  #3
Mar 19th, 2008
i would also be interested in something like this.

John i had tried something like this a while ago.
I USED Urllib to retrieve the html code of a given search results page supplied by me.
However with all the other links like advertising and such in the html code i was unabke to determine the top 10 links as listed on the page.

Might be a place you could get started maybe. sorry i cannot help more.

If anyone does have anymore info on this i would really appreciate it.

Thanks guys
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 181
Reputation: Paul.Esson is an unknown quantity at this point 
Solved Threads: 10
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster

Re: python + web

 
0
  #4
Mar 19th, 2008
Yet again, Not a python coder, Just crusing around on the python fourms.

But if I was going to attempt to do somthing as such I would be looking at how to do a HTTP GET request good looking artical here and also look at how you would parse your HTML perhaps using regular epressions explained here

Anyhow hope this helps somehow
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 181
Reputation: Paul.Esson is an unknown quantity at this point 
Solved Threads: 10
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster

Re: python + web

 
0
  #5
Mar 19th, 2008
John i had tried something like this a while ago.
I USED Urllib to retrieve the html code of a given search results page supplied by me.
However with all the other links like advertising and such in the html code i was unabke to determine the top 10 links as listed on the page.
I think you will have to have a look at the surrounding tages for each link. If you have a look at google you will notice that all sponsored links are in a sepirate div tags. The best way to tackle this may be to do say 12 separate seraches on google that return sponsors then chuck them into diff see what changes and what is similar about the pages.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 42
Reputation: 1337455 10534 is an unknown quantity at this point 
Solved Threads: 7
1337455 10534 1337455 10534 is offline Offline
Light Poster

Re: python + web

 
0
  #6
Mar 19th, 2008
found something awesome;
  1. import webbrowser
  2. file = 'any media or html/xml file you like.extension'
  3. webbrowser.open('%s' % file)
"And da wind cry moron." ~ Pearls Before Swine
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 3
Reputation: wwwalker is an unknown quantity at this point 
Solved Threads: 1
wwwalker's Avatar
wwwalker wwwalker is offline Offline
Newbie Poster

Re: python + web

 
0
  #7
Mar 20th, 2008
Last edited by wwwalker; Mar 20th, 2008 at 1:31 am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 4
Reputation: Uncle_John is an unknown quantity at this point 
Solved Threads: 0
Uncle_John Uncle_John is offline Offline
Newbie Poster

Re: python + web

 
0
  #8
Mar 21st, 2008
hey, thanks for those answers, but i already have another question for you

how can i make a python program that could press a button or login on some website?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 3
Reputation: wwwalker is an unknown quantity at this point 
Solved Threads: 1
wwwalker's Avatar
wwwalker wwwalker is offline Offline
Newbie Poster

Re: python + web

 
0
  #9
Mar 22nd, 2008
Last edited by wwwalker; Mar 22nd, 2008 at 4:36 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC