@koalarx/scrapping 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/KoalaScrappingDom.d.ts +58 -0
- package/KoalaScrappingDom.js +766 -0
- package/KoalaScrappingDom.js.map +1 -0
- package/KoalaScrappingSystem.d.ts +22 -0
- package/KoalaScrappingSystem.js +228 -0
- package/KoalaScrappingSystem.js.map +1 -0
- package/LICENSE +24 -0
- package/README.md +2 -0
- package/enums/BrowserEnum.d.ts +10 -0
- package/enums/BrowserEnum.js +15 -0
- package/enums/BrowserEnum.js.map +1 -0
- package/errors/NotFoundError.d.ts +2 -0
- package/errors/NotFoundError.js +6 -0
- package/errors/NotFoundError.js.map +1 -0
- package/interfaces/KoalaSystemConfigInterface.d.ts +23 -0
- package/interfaces/KoalaSystemConfigInterface.js +3 -0
- package/interfaces/KoalaSystemConfigInterface.js.map +1 -0
- package/interfaces/ResponseInterface.d.ts +6 -0
- package/interfaces/ResponseInterface.js +3 -0
- package/interfaces/ResponseInterface.js.map +1 -0
- package/interfaces/SendKeysInterface.d.ts +4 -0
- package/interfaces/SendKeysInterface.js +3 -0
- package/interfaces/SendKeysInterface.js.map +1 -0
- package/interfaces/SystemInterface.d.ts +10 -0
- package/interfaces/SystemInterface.js +3 -0
- package/interfaces/SystemInterface.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Browser, Page } from 'puppeteer';
|
|
2
|
+
import { KoalaSystemConfigInterface } from './interfaces/KoalaSystemConfigInterface';
|
|
3
|
+
export declare abstract class KoalaScrappingDom<CustomDataType> {
|
|
4
|
+
private option;
|
|
5
|
+
protected browser: Browser;
|
|
6
|
+
protected page: Page;
|
|
7
|
+
protected idCaptcha: string;
|
|
8
|
+
private mensagemAlert;
|
|
9
|
+
private _offDialog;
|
|
10
|
+
/**
|
|
11
|
+
* @param option | URl da página de início do processo
|
|
12
|
+
*/
|
|
13
|
+
protected constructor(option: KoalaSystemConfigInterface<CustomDataType>);
|
|
14
|
+
closeDOM(): Promise<void>;
|
|
15
|
+
protected openTab(url: string): Promise<void>;
|
|
16
|
+
protected getLastPage(): Promise<Page>;
|
|
17
|
+
offDialog(): Promise<void>;
|
|
18
|
+
protected getDataFromTable(xPath: string): Promise<object[]>;
|
|
19
|
+
protected switchLastTab(): Promise<void>;
|
|
20
|
+
protected closeTab(): Promise<void>;
|
|
21
|
+
private initObservableDialog;
|
|
22
|
+
protected goTo(url: string): Promise<void>;
|
|
23
|
+
protected clearInput(xpath: string): Promise<void>;
|
|
24
|
+
protected pasteValueInField(xPath: string, keys: string, displayNone?: boolean, hardValidation?: boolean, valueFix?: boolean): Promise<void>;
|
|
25
|
+
protected writeTextInField(xPath: string, value: string): Promise<void>;
|
|
26
|
+
protected authenticate(): Promise<void>;
|
|
27
|
+
protected init(headless?: boolean, devtools?: boolean): Promise<void>;
|
|
28
|
+
reloadPage(): Promise<void>;
|
|
29
|
+
blockReloadPage(block: boolean): void;
|
|
30
|
+
protected waitForXpathIsNotVisible(xPath: string, waitFor?: number): Promise<void>;
|
|
31
|
+
protected displayNone(xpath: string): Promise<void>;
|
|
32
|
+
protected displayVisible(xpath: string): Promise<void>;
|
|
33
|
+
protected getTextContentOnElement(xPath: string, delayUntil?: number): Promise<string>;
|
|
34
|
+
protected getTextContentOnInputElement(xPath: string): Promise<string>;
|
|
35
|
+
protected existElementOnList(xPathList: string[], containsMessageError?: string[], delayUntil?: number): Promise<boolean>;
|
|
36
|
+
protected existElement(xPath: string, delayUntil?: number): Promise<boolean>;
|
|
37
|
+
protected waitForDialogAlert(ms?: number): Promise<unknown>;
|
|
38
|
+
private waitForDialogAlert2;
|
|
39
|
+
protected alert(msg: string): Promise<void>;
|
|
40
|
+
protected scrollPageAxisXY(x?: number, y?: number): Promise<void>;
|
|
41
|
+
protected keyboardPress(xPath: string, optionKey: 'Tab' | 'Enter' | 'Backspace'): Promise<void>;
|
|
42
|
+
protected selectorInputValue(idSelector: string, keys: string, displayNone?: boolean, waitFor?: number, hardValidation?: boolean, delayHardValidation?: number): Promise<void>;
|
|
43
|
+
protected verifyFrameIsOpened(identifier: string): Promise<boolean>;
|
|
44
|
+
protected click(xPath: string, waitFor?: number): Promise<void>;
|
|
45
|
+
private getTable;
|
|
46
|
+
protected getValueCheckbox(xpath: string): Promise<boolean>;
|
|
47
|
+
protected getHrefFromAnchor(xPath: string): Promise<string>;
|
|
48
|
+
protected getSrcFromImage(xPath: string): Promise<string>;
|
|
49
|
+
protected getTitleFromElement(xPath: string): Promise<string>;
|
|
50
|
+
protected sendKeys(xPath: string, keys: string, displayNone?: boolean, hardValidation?: boolean): Promise<void>;
|
|
51
|
+
protected getMessageAlert(xPathSuccess?: string, waitDialog?: number): Promise<string>;
|
|
52
|
+
protected waitElementIsVisible(xPath: string, delayUntil?: number): Promise<boolean>;
|
|
53
|
+
protected checkOnCheckBox(xPath: string): Promise<void>;
|
|
54
|
+
protected waitElementWhileIsVisible(xPath: string, delayUntil?: number): Promise<boolean>;
|
|
55
|
+
protected selectorInputValueForXpath(xPathSelector: string, keys: string, displayNone?: boolean, waitFor?: number): Promise<void>;
|
|
56
|
+
protected getOptionOnSelect(idSelect: string): Promise<string[]>;
|
|
57
|
+
protected clickOnMenuHover(xPathMenuUl: string, xPathClick: string): Promise<void>;
|
|
58
|
+
}
|