diff --git a/.gitignore b/.gitignore index fa5de12f..2577e997 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Игнорируем новые файлы из Google Portable +# Игнорируем новые файлы из Google Portable /**/Resources/GoogleChromePortable #Игнорируем все папки с названием __pycache__ /**/__pycache__/** @@ -21,4 +21,5 @@ /**/Orchestrator/screenshot.png **/.idea/** /**/screenshot.png -/**/*.log \ No newline at end of file +/**/*.log +3. AppWEB_Habr.md \ No newline at end of file diff --git a/Wiki/RUS_Tutorial/WebGUI_Habr/3. MonitoringCIAN_Run_64.py b/Wiki/RUS_Tutorial/WebGUI_Habr/3. MonitoringCIAN_Run_64.py index a5df21e0..a4457797 100644 --- a/Wiki/RUS_Tutorial/WebGUI_Habr/3. MonitoringCIAN_Run_64.py +++ b/Wiki/RUS_Tutorial/WebGUI_Habr/3. MonitoringCIAN_Run_64.py @@ -67,11 +67,11 @@ lResult = { "SearchItems": {} # prepare the result } # Get List of the page -lOfferListCSSStr = 'div[data-name="Offers"] > div:not([data-name="BannerServicePlaceInternal"]):not([data-name="getBannerMarkup"]):not([data-name="AdFoxBannerTracker"])' -lOfferList = lWebDriver.find_elements_by_css_selector(css_selector=lOfferListCSSStr) lNextPageItemCSS = 'div[data-name="Pagination"] li[class*="active"] + li a' lNextPageItem = lWebDriver.find_element_by_css_selector(lNextPageItemCSS) while lNextPageItem: + lOfferListCSSStr = 'div[data-name="Offers"] > div:not([data-name="BannerServicePlaceInternal"]):not([data-name="getBannerMarkup"]):not([data-name="AdFoxBannerTracker"])' + lOfferList = lWebDriver.find_elements_by_css_selector(css_selector=lOfferListCSSStr) for lOfferItem in lOfferList: # Processing the item, extract info lOfferItemInfo = { # Item URL with https "TitleStr": "3-комн. кв., 31,4 м², 5/8 этаж", # Offer title [str] @@ -88,7 +88,7 @@ while lNextPageItem: lOfferItemInfo["TitleStr"] = lTitleStr # set the title lPriceStr = lPriceStr.replace(" ","").replace("₽","") lOfferItemInfo["PriceFloat"] = round(float(lPriceStr),2) # Set the price - lREResult = re.match(r"(\d)-комн. .*, (\d*,?\d*) м², (\d*)/(\d*) эта.", lTitleStr) # run the re + lREResult = re.search(r".*(\d)-комн. .*, (\d*,?\d*) м², (\d*)/(\d*) эта.", lTitleStr) # run the re lOfferItemInfo["RoomCountInt"] = lREResult.group(1) # Room count lSqmStr = lREResult.group(2) lSqmStr= lSqmStr.replace(",",".") @@ -108,8 +108,13 @@ while lNextPageItem: lWebDriver.execute_script("""document.querySelector('div[data-name="Pagination"] li[class*="active"] + li a').click()""") except Exception as e: print(e) - time.sleep(3) - lOfferList = lWebDriver.find_elements_by_css_selector(css_selector=lOfferListCSSStr) + time.sleep(0.5) # some init operations + # wait while preloader is active + lDoWaitBool = True + while lDoWaitBool: + lPreloaderCSS = inWebDriver.find_elements_by_css_selector(css_selector='div[class*="--preloadOverlay--"]') + if len(lPreloaderCSS)>0: time.sleep(0.5) # preloader is here - wait + else: lDoWaitBool = False # Stop wait if preloader is dissappear # Save result in file lFile = open(f"{lResult['SearchKeyStr']}_{lDatetimeNowStr.replace(' ','_').replace('-','_').replace(':','_')}","w",encoding="utf-8") lFile.write(json.dumps(lResult)) diff --git a/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr announce.png b/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr announce.png new file mode 100644 index 00000000..48e86a57 Binary files /dev/null and b/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr announce.png differ diff --git a/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr announce.pptx b/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr announce.pptx new file mode 100644 index 00000000..662817ee Binary files /dev/null and b/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr announce.pptx differ diff --git a/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr welcome.pptx b/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr welcome.pptx new file mode 100644 index 00000000..901886b2 Binary files /dev/null and b/Wiki/RUS_Tutorial/WebGUI_Habr/3. pyOpenRPA Tutorial Habr welcome.pptx differ