Subversion Repositories SmartDukaan

Rev

Rev 4039 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3232 varun.gupt 1
'''
2
Created on 24-Aug-2011
3
 
4
@author: Varun Gupta
5
'''
6
from BeautifulSoup import BeautifulSoup
7
import urllib
8
 
9
class InfibeamScraper:
10
 
11
    def __init__(self):
12
        self.url = None
13
        self.id = None
14
 
15
    def setUrl(self, url):
16
        self.url = url
17
 
18
    def scrape(self):
19
        sock = urllib.urlopen(self.url)
20
        html = sock.read()
21
        sock.close()
22
        self.soup = BeautifulSoup(html)
23
 
24
    def getPhonePrices(self):
25
        phone_prices = []
26
 
27
        return phone_prices
28
 
29
    def getNextUrl(self):
30
        pass
31
 
32
if __name__ == '__main__':
33
    s = InfibeamScraper()
34
    s.setUrl('http://www.infibeam.com/Mobiles/search')
35
    s.scrape()
36
    print s.getNextUrl()