def start_link_search(self, driver): if self.transaction_control and (self.link == '0' or self.link == 0): barcode = isbn_to_barcode(self.isbn) if barcode: try: driver.get( 'https://www.customer09.ru/search/result/?page=1') tag = driver.find_elements_by_xpath( "//form[@action='/search/result/']//input[@type='text']" ) if tag: tag[0].send_keys(barcode) btn = driver.find_elements_by_xpath( "//form[@action='/search/result/']//button") if btn: btn[0].click() time.sleep(0.5) tag_two = driver.find_elements_by_xpath( "//div[contains(@class, 'product-card__info')]//a[contains(@href, '/catalog/')]" ) if tag_two: link = tag_two[0].get_attribute('href') if link: self.link = link except: try: driver.get( 'https://www.customer09.ru/search/result/?page=1') popup_window = driver.find_elements_by_xpath( "//a[@id='cityYes']") if popup_window: if popup_window[0].is_displayed(): popup_window[0].click() time.sleep(0.5) tag = driver.find_elements_by_xpath( "//form[@action='/search/result/']//input[@type='text']" ) if tag: tag[0].send_keys(barcode) btn = driver.find_elements_by_xpath( "//form[@action='/search/result/']//button" ) if btn: btn[0].click() time.sleep(0.5) tag_two = driver.find_elements_by_xpath( "//div[contains(@class, 'product-card__info')]//a[contains(@href, '/catalog/')]" ) if tag_two: link = tag_two[0].get_attribute( 'href') if link: self.link = link except: pass else: pass
def start_link_search(self, driver): if self.transaction_control and (self.link == '0' or self.link == 0): barcode = isbn_to_barcode(self.isbn) if barcode: try: driver.get('https://www.customer07.ru/books?q=' + barcode) tag = driver.find_elements_by_css_selector( 'div#books a[href*="www.customer07.ru/book?"]') if tag: link = tag[0].get_attribute('href') if link: self.link = link except: pass else: pass
def start_link_search(self, driver): if self.transaction_control and (self.link == '0' or self.link == 0): barcode = isbn_to_barcode(self.isbn) if barcode: try: driver.get('http://www.customer11.ru/search?q=' + barcode) tag = driver.find_elements_by_xpath( "//div[@class='products']//form//a[contains(@class, product_card)]" ) if tag: link = tag[0].get_attribute('href') if link: self.link = link except: pass else: pass
def start_link_search(self, driver): if self.transaction_control and (self.link == '0' or self.link == 0): barcode = isbn_to_barcode(self.isbn) if barcode: try: driver.get('https://www.customer18.ru/search/?text=' + barcode) time.sleep(2.5) tag = driver.find_elements_by_css_selector( 'a.tile-wrapper') if tag: link = tag[0].get_attribute('href') if link: self.link = link except: pass else: pass
def start_link_search(self, driver): if self.transaction_control and (self.link == '0' or self.link == 0): barcode = isbn_to_barcode(self.isbn) if barcode: try: driver.get( 'https://www.customer17.ru/sitesearch.html?query=' + barcode) time.sleep(1.5) tag = driver.find_elements_by_xpath( "//div[@class='indexGoods__item']//a[contains(@href, '/catalogue/')]" ) if tag: link = tag[0].get_attribute('href') if link: self.link = link except: pass else: pass