Пример #1
0
 def __init__(self):
     options = config.get_driver_options()
     config.set_ignore_certificate_error(options)
     config.set_browser_as_incognito(options)
     config.set_browser_as_headless(options)
     self.driver = config.get_chrome_driver(options)
     pass
Пример #2
0
 def __init__(self,search_term,base_url,currency):
     self.search_term=search_term
     self.base_url=base_url
     options=get_web_driver_options()
     set_browser_as_incognito(options)
     set_ignore_certificate_error(options)
     self.driver=get_chrome_web_driver(options)
     self.currency=currency
 def __init__(self, search_term, filters, base_url, currency):
     self.base_url = base_url
     self.search_term = search_term
     options = get_web_driver_options()
     set_ignore_certificate_error(options)
     set_browser_as_incognito(options)
     self.driver = get_chrome_web_driver(options)
     self.currency = currency
     self.price_filter = f"&rh=p_36%3A{filters['min']}00-{filters['max']}00"
Пример #4
0
 def __init__(self, search_term, filters, base_url,
              currency):  # AmazonAPI 인스턴스 생성시 호출되는 메서드, 그 안에 정의되고 호출될 메서드들
     self.base_url = base_url  # 아마존 url
     self.search_term = search_term  # 검색 키워드
     options = get_web_driver_options()  # 옵션 객체 생성
     set_ignore_certificate_error(options)  # certificate error 발생 무시
     set_browser_as_incognito(options)  # 크롬 시크릿 모드 실행
     self.driver = get_chrome_web_driver(options)  # 웹 드라이버 인스턴스 생성
     self.currency = currency  # 화페 속성
     self.price_filter = f"&rh=p_36%3A{filters['min']}00-{filters['max']}00"  # url에서 가격 필터 파라미터 값 지정
Пример #5
0
 def __init__(self, search_term, filter, base_url, currency):
     self.base_url = base_url
     self.search_term = search_term
     options = get_web_driver_options()
     set_ignore_certificate_error(options)
     set_browser_as_incognito(options)
     self.driver = get_chrome_web_driver(options)
     self.currency = currency
     self.price_filter = f"&rh=n%3A976460031%2Cp_36%3A{filter['min']}00-{filter['max']}00"  ## To avoid tracking by amazon we will use the parameteres given by with all the filters min - max price.
     pass
Пример #6
0
 def __init__(self, search_term, filters, base_url, currency):
     """
     Init all needed variables and mehtods for the API to work
     """
     self.base_url = base_url
     self.search_term = search_term
     options = get_web_driver_options()
     set_ignore_certificate_error(options)
     set_browser_as_incognito(options)
     self.driver = get_chrome_web_driver(options)
     self.currency = currency
Пример #7
0
 def __init__(self, search_term, filters, base_url, currency):
   self.base_url = base_url
   # This is the NAME parameter that is passed when AmazonAPI() is called in main function
   self.search_term = search_term
   #Fetch the options  
   options = get_web_driver_options() 
   set_ignore_certificate_error(options)
   set_browser_as_incognito(options)
   # Call the webdriver with the added flags (options)
   self.driver = get_chrome_web_driver(options) 
   self.currency = currency
   # Add price min and max to amazon url
   self.price_filter = f"&rh=p_36%3A{filters['min']}00-{filters['max']}00"   
   pass
Пример #8
0
 def __init__(self, base_url):
     self.base_url = base_url
     options = get_web_driver_options()
     set_ignore_certificate_error(options)
     set_browser_as_incognito(options)
     self.driver = get_chrome_web_driver(options)