Esempio n. 1
0
 def search(self):
     seed = Seed()
     results = Results()
     blacklist = Blacklist()
     filtered_results = set()
     for _ in seed:
         _retry(self.find_elements_by_class_name, '_586i')[0].send_keys(
             'garage sale ' + _
         )
         time.sleep(1.5)
         _results = set()
         for elem in _retry(self.find_elements_by_class_name, 'fragmentEnt'):
             try:
                 new_term = str(elem.text)
                 _results.add(new_term)
                 if new_term not in results:
                     results + new_term
                     pprint(list(results))
             except Exception as e:
                 print e
         filtered_results.add('\n'.join(list(_results - set(list(blacklist)))))
         # self._show_results(_, _results, filtered_results)
         _retry(self.find_elements_by_class_name, '_586i')[0].clear()
     results._filter(list(blacklist))
     pprint(list(results))
Esempio n. 2
0
 def search(self):
     seed = Seed()
     def start(term):
         _retry(self.find_element_by_id, self.search_box_id).clear()
         _retry(self.find_element_by_id, self.search_box_id).send_keys(
             'black friday {} sale'.format(term)
         )
         _retry(self.find_element_by_id, self.search_box_id).click()
         time.sleep(1.5)
     for _ in seed:
         start(_)
         links = _retry(
             self.find_elements_by_class_name, self.search_links_class_name
         )
         # raw_input([link.text for link in links])
         for link in links:
             _retry(link.click())
             print self.current_url
Esempio n. 3
0
 def search(self):
     seed = Seed()
     def start(term):
         _retry(self.find_element_by_id, self.search_box_id).clear()
         _retry(self.find_element_by_id, self.search_box_id).send_keys(
             'cyber monday {} sale'.format(term)
         )
         time.sleep(1)
     for _ in seed:
         start(_)
         _retry(self.find_element_by_id, self.search_submit_id).click()
         time.sleep(1)
         links = _retry(self.find_elements_by_class_name, 'r')
         time.sleep(1)
         try:
             pprint(re.findall(r'<a href="(.*">.*)</a>', self.page_source))
         except:
             pass
         url = self.current_url
Esempio n. 4
0
 def start(term):
     _retry(self.find_element_by_id, self.search_box_id).clear()
     _retry(self.find_element_by_id, self.search_box_id).send_keys(
         'black friday {} sale'.format(term)
     )
     _retry(self.find_element_by_id, self.search_box_id).click()
     time.sleep(1.5)
Esempio n. 5
0
 def start(term):
     _retry(self.find_element_by_id, self.search_box_id).clear()
     _retry(self.find_element_by_id, self.search_box_id).send_keys(
         'cyber monday {} sale'.format(term)
     )
     time.sleep(1)