티스토리 뷰

  • 알라바바(Alibaba) 웹페이지(https://www.alibaba.com)에서 특정 키워드를 검색하여 검색 결과를 가져오는 파이썬 프래그램 소스 코드
  • Filename : BAlibaba.py
  • Project name : BilientService233

 

    def Test01(self, paramIn=None):
        # paramIn = {'Keyword'}
        keyWord = "USB C Charger"

        if self.IsTesting: webDriver = bWebControl.GetWebDriver(False)
        else: webDriver = bWebControl.GetWebDriver()

        webDriver = bWebControl.AccessPage(webDriver, self.MainPageURL)
        targetTagID = "AL10"
        elem1 = self.PageTagInfo.GetTargetElem(webDriver, targetTagID)

        text11 = elem1.text
        print(text11)
        webDriver = bWebControl.InputKeyword(webDriver, elem1, keyWord)
        bWebControl.SendRETURN(webDriver, elem1, 3)
        tagID11 = "AL11"
        self.PageTagInfo.SetPageElem(tagID11, webDriver)
        '''
        elem21 = webDriver.find_element(By.CLASS_NAME, "app-organic-search__main-body")
        print(elem21.text)
        elem22 = elem21.find_element(By.CLASS_NAME, "app-organic-search__content")
        print(elem22.text)
        '''
        targetTagID = "AL26"
        elems2 = self.PageTagInfo.GetTargetElem(webDriver, targetTagID)
        for elem21 in elems2:
            text21 = bWebControl.GetTextinElement(elem21)
            print(text21)


        webDriver.quit()
반응형