| Line 94... |
Line 94... |
| 94 |
Xpath3 = Give us quoted price for individual phone
|
94 |
Xpath3 = Give us quoted price for individual phone
|
| 95 |
vatplustax = to get final price from quoted price
|
95 |
vatplustax = to get final price from quoted price
|
| 96 |
Removelist = To filer the prices so as to make them integer for eg remove ',' or 'Rs'
|
96 |
Removelist = To filer the prices so as to make them integer for eg remove ',' or 'Rs'
|
| 97 |
"""
|
97 |
"""
|
| 98 |
da = DataHelper()
|
98 |
da = DataHelper()
|
| 99 |
msg(response.url)
|
- |
|
| 100 |
#INFIBEAM_VATPLUSTAX = 0
|
99 |
#INFIBEAM_VATPLUSTAX = 0
|
| 101 |
INFIBEAM_VATPLUSTAX = int(get_code_word("INFIBEAM_VATPLUSTAX"))
|
100 |
INFIBEAM_VATPLUSTAX = int(get_code_word("INFIBEAM_VATPLUSTAX"))
|
| 102 |
#list elements are separated by ';'
|
101 |
#list elements are separated by ';'
|
| 103 |
#INFIBEAM_REMOVELIST = ["Rs.",",","-","/","Rs"]
|
102 |
#INFIBEAM_REMOVELIST = ["Rs.",",","-","/","Rs"]
|
| 104 |
INFIBEAM_REMOVELIST = get_code_word("INFIBEAM_REMOVELIST")
|
103 |
INFIBEAM_REMOVELIST = str(get_code_word("INFIBEAM_REMOVELIST"))
|
| - |
|
104 |
if len(INFIBEAM_REMOVELIST)>0:
|
| 105 |
INFIBEAM_REMOVELIST = INFIBEAM_REMOVELIST.split(';')
|
105 |
INFIBEAM_REMOVELIST = INFIBEAM_REMOVELIST.split(';')
|
| 106 |
hxs = HtmlXPathSelector(response)
|
106 |
hxs = HtmlXPathSelector(response)
|
| 107 |
#INFIBEAM_XPATH1 = '//ul[@class="srch_result portrait"]/li'
|
107 |
#INFIBEAM_XPATH1 = '//ul[@class="srch_result portrait"]/li'
|
| 108 |
INFIBEAM_XPATH1 = get_code_word("INFIBEAM_XPATH1")
|
108 |
INFIBEAM_XPATH1 = get_code_word("INFIBEAM_XPATH1")
|
| 109 |
phone_info = hxs.select(INFIBEAM_XPATH1)
|
109 |
phone_info = hxs.select(INFIBEAM_XPATH1)
|
| 110 |
#INFIBEAM_XPATH2 = './/p/span[@class="title"]/text()'
|
110 |
#INFIBEAM_XPATH2 = './/p/span[@class="title"]/text()'
|
| 111 |
INFIBEAM_XPATH2 = get_code_word("INFIBEAM_XPATH2")
|
111 |
INFIBEAM_XPATH2 = get_code_word("INFIBEAM_XPATH2")
|
| 112 |
#INFIBEAM_XPATH3 = './/p/span[@class="price"]/text()'
|
112 |
#INFIBEAM_XPATH3 = './/p/span[@class="price"]/text()'
|
| 113 |
INFIBEAM_XPATH3 = get_code_word("INFIBEAM_XPATH3")
|
113 |
INFIBEAM_XPATH3 = get_code_word("INFIBEAM_XPATH3")
|
| 114 |
items = []
|
114 |
items = []
|
| 115 |
msg(response.url)
|
- |
|
| 116 |
|
115 |
|
| 117 |
if not phone_info:
|
116 |
if not phone_info:
|
| 118 |
ct = int(da.get_extra_vars('infibeam_count'))
|
117 |
ct = int(da.get_extra_vars('infibeam_count'))
|
| 119 |
if ct>14:
|
118 |
if ct>14:
|
| 120 |
fails = int(da.get_extra_vars('infibeam_fails'))
|
119 |
fails = int(da.get_extra_vars('infibeam_fails'))
|
| Line 136... |
Line 135... |
| 136 |
while amnt.find(r) != -1:
|
135 |
while amnt.find(r) != -1:
|
| 137 |
amnt = amnt.replace(r, "")
|
136 |
amnt = amnt.replace(r, "")
|
| 138 |
amnt = amnt.strip()
|
137 |
amnt = amnt.strip()
|
| 139 |
pr = int(amnt) + INFIBEAM_VATPLUSTAX
|
138 |
pr = int(amnt) + INFIBEAM_VATPLUSTAX
|
| 140 |
da.add_infiphone(i['name'], amnt,pr)
|
139 |
da.add_infiphone(i['name'], amnt,pr)
|
| 141 |
|
- |
|
| 142 |
|
140 |
|
| 143 |
SPIDER = infi_spider()
|
141 |
SPIDER = infi_spider()
|
| 144 |
|
142 |
|