{"_id":"@data-master/web-extractor","_rev":"6-a8fda6ac7251158882351c599686b7b5","name":"@data-master/web-extractor","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@data-master/web-extractor","version":"1.0.0","description":"Represents a web retrieval method that retrieves content from the `textContent` property of a document node. Extends the `WebRetrieveMethod` class.","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@babel/preset-react":"^7.22.5"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@1.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-E3skB31VJ1ewFsXdFrrFuTa2VDMM9ZYVb4xRiVUcOfUJYM9wH9G232iPHynT0uxuZuvw0YdhZ9ZpW9DZYi8oAw==","shasum":"8f20685675476c3061ba0b40cbfa20c9641b7e0d","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-1.0.0.tgz","fileCount":36,"unpackedSize":110579,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGL7LH2f7rqaR/a3E/IqyZ9aoSzOwyCwj5ft2Aj9K8hSAiEAxuMNB6oPj3yz4N7EaIbYb6n0pP/y+8ZRbQgfY/X4hIE="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_1.0.0_1687984928543_0.34729778783561405"},"_hasShrinkwrap":false},"1.1.0":{"name":"@data-master/web-extractor","version":"1.1.0","description":"Represents a web retrieval method that retrieves content from the `textContent` property of a document node. Extends the `WebRetrieveMethod` class.","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@babel/preset-react":"^7.22.5"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@1.1.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-qQSevUT4rxhTaXTjowhBrrE+O8yOP4YMJAWf6nQeyRVEovWynKLyg3leJC63LnCbpS/rlQ5M27LPaHmpiLS/MA==","shasum":"a4f233f6c78945ed50373caedf3d208e739557d2","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-1.1.0.tgz","fileCount":36,"unpackedSize":111486,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+cJsuwiE7yhlpz0uGLB1rZtH0wwOQmF7Lj92V3hfdmAiBYYP7CMmNQXEMYna068MahXmRfCmRU6HYmR28LBQpAQA=="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_1.1.0_1688228738998_0.2625379894388422"},"_hasShrinkwrap":false},"1.2.0":{"name":"@data-master/web-extractor","version":"1.2.0","description":"Represents a web retrieval method that retrieves content from the `textContent` property of a document node. Extends the `WebRetrieveMethod` class.","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@babel/preset-react":"^7.22.5"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@1.2.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-JvQjVeB+4Guvlw2aFsVxHHvXzp3a3nzETGOS+BMPqD4RhGfYP9hmn5LP1iyaDFWpGna8iZK3ypdAv2KG0GcfLg==","shasum":"641b26c478298750f14a797994ab3739ac71eaae","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-1.2.0.tgz","fileCount":38,"unpackedSize":130415,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7l2C18TWJq6K3bvgortbqNPFF4nkYYwhQatlcm7OyKgIgGgpqQOC6blnw/X+rnXhOo6qDmpKkowa3XrHUiJ2id58="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_1.2.0_1688644019300_0.4846691971603565"},"_hasShrinkwrap":false},"1.3.0":{"name":"@data-master/web-extractor","version":"1.3.0","description":"Represents a web rule with its properties and methods.","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@babel/preset-react":"^7.22.5"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@1.3.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-hDTPCwPoHNVB3+ewzvOHh5MG7LX051KEO3QcqivE6JNjb42+tz2OAAVyVbxAmPuCFoh3sHm8gprGMFhihbYc8w==","shasum":"d7a1975dd64cf037873dab36b4e5015ca6d71995","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-1.3.0.tgz","fileCount":41,"unpackedSize":159574,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkVGBjyqcIKoLy9xY8RkXnCYp+GaaGlaB+X2FqiXG/CAiAc5v4RtsFP8DBpbSJe8C3zjIQQUXt6AikGkbXm0gMbOA=="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_1.3.0_1690200507808_0.6610958457159504"},"_hasShrinkwrap":false},"1.4.0":{"name":"@data-master/web-extractor","version":"1.4.0","description":"Represents a web rule with its properties and methods.","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@babel/preset-react":"^7.22.5"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@1.4.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-DoJDAgOFrfVJN+hGrEEYd7Ov1rJ24pPDBpNvWUgvSCIArBnqpsFlMNqACG7SuvV0tHXDsnr6f6ku1yYlp1qBzQ==","shasum":"42d1f0226dbe9e6940768ca41c00583f7bc387e8","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-1.4.0.tgz","fileCount":44,"unpackedSize":191299,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXZc0us3WN5ZMDtN/1XPL0c/5KcbtMmGGIRIDAGF9TtQIgfX+1whLKlNxRvrAHr4/+7VD1YcVsNXHLwXJdubU4YHM="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_1.4.0_1690201973569_0.6519442352917177"},"_hasShrinkwrap":false},"1.5.0":{"name":"@data-master/web-extractor","version":"1.5.0","description":"Represents a web rule with its properties and methods.","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel src -d dist"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@babel/preset-react":"^7.22.5"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@1.5.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-yYlDeN6fR6QanLoizmmdFjVQGn9R0ZOtV4akYC04Vo10xCfE7Qv6o7ZkKzEsKPLmmddqSVflh910BE287qV6qA==","shasum":"275f29e86d8988cd51781d6f597282d5976331a3","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-1.5.0.tgz","fileCount":44,"unpackedSize":203605,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZXK7mcL/6UCRVCpl74/K5tXdEnib5N40voq1ffUmcmgIgL7dQR6xuVhsBdxvcM6n7wMt+lVfExHE1WyZNnzGYSzg="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_1.5.0_1690286150797_0.3490791378642375"},"_hasShrinkwrap":false},"2.0.0":{"name":"@data-master/web-extractor","version":"2.0.0","description":"Represents a web rule with its properties and methods.","main":"dist/cjs/index.js","module":"dist/esm/index.js","exports":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"babel lib -d dist","build:esm":"cross-env BABEL_ENV=esmUnbundled babel lib --extensions '.js' --out-dir 'dist/esm' --source-maps","build:cjs":"cross-env BABEL_ENV=cjs babel lib --extensions '.js' --out-dir 'dist/cjs' --source-maps"},"author":"","license":"ISC","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.4","@babel/preset-env":"^7.22.5","@babel/preset-react":"^7.22.5","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","cross-env":"^7.0.3"},"engines":{"node":">=14.17.0"},"_id":"@data-master/web-extractor@2.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"integrity":"sha512-BTKB8yB2GxHFhJ4o7SGNZf40qBhgW9VL7xqXK2j7ePgZCynW63vKRjdXVgSuDsUGe5Lj/E8qy6HdWG0pw9qUZQ==","shasum":"8cbed9b4a92d50d51d485e0c71785723cdeb16b8","tarball":"https://registry.npmjs.org/@data-master/web-extractor/-/web-extractor-2.0.0.tgz","fileCount":8,"unpackedSize":455197,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+qlb4KGozg7Vv5s7AWuLRizXQ9kRg2JagK9jNT+YSLAIgRnShaygTZNa+OCjpP6gaUcZnUSSWnoA34Xva+OzNtcY="}]},"_npmUser":{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"},"directories":{},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-extractor_2.0.0_1690452268901_0.38659961953930355"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-28T20:42:08.463Z","1.0.0":"2023-06-28T20:42:08.730Z","modified":"2023-07-27T10:04:29.197Z","1.1.0":"2023-07-01T16:25:39.209Z","1.2.0":"2023-07-06T11:46:59.466Z","1.3.0":"2023-07-24T12:08:27.993Z","1.4.0":"2023-07-24T12:32:53.742Z","1.5.0":"2023-07-25T11:55:51.009Z","2.0.0":"2023-07-27T10:04:29.092Z"},"maintainers":[{"name":"darkknight","email":"mail.biswas.arnab@gmail.com"}],"description":"Represents a web rule with its properties and methods.","license":"ISC","readme":"# Web Extractor\r\n\r\n\r\n## Class: WebRule\r\n\r\nRepresents a web rule with its properties and methods.\r\n\r\n### Constructor\r\n\r\n#### WebRule(id: string)\r\n\r\nCreates a new instance of the WebRule class with the specified `id`.\r\n\r\n- `id` (string): The unique identifier for the web rule.\r\n\r\n### Properties\r\n\r\n- `version` (number): The version of the web rule.\r\n- `id` (string): The unique identifier for the web rule.\r\n- `structures` (array): An array of WebStructure instances associated with the web rule.\r\n- `fields` (array): An array of WebFields instances associated with the web rule.\r\n- `meta` (object): Additional metadata associated with the web rule.\r\n- `type` (string): The type of the web rule.\r\n\r\n### Methods\r\n\r\n#### setVersion(version: number)\r\n\r\nSets the version of the web rule.\r\n\r\n- `version` (number): The version number to set.\r\n\r\n#### addStructure(structure: WebStructure)\r\n\r\nAdds a WebStructure instance to the web rule.\r\n\r\n- `structure` (WebStructure): The WebStructure instance to add.\r\n\r\n#### addFields(field: WebFields)\r\n\r\nAdds a WebFields instance to the web rule.\r\n\r\n- `field` (WebFields): The WebFields instance to add.\r\n\r\n#### toJSON(): object\r\n\r\nSerializes the web rule object to a JSON representation.\r\n\r\n- Returns: An object representing the serialized web rule.\r\n\r\n#### setMeta(key: string, value: any)\r\n\r\nSets a metadata value for the specified key.\r\n\r\n- `key` (string): The key of the metadata.\r\n- `value` (any): The value to set for the specified key.\r\n\r\n#### run(): object\r\n\r\nExecutes the web rule by running its associated structures and fields.\r\n\r\n- Returns: An object containing the storage information and the timestamp of the execution.\r\n\r\n#### static fromJSON(ruleJSON: string): WebRule\r\n\r\nCreates a new WebRule instance from a JSON representation.\r\n\r\n- `ruleJSON` (string): The JSON representation of the web rule.\r\n\r\n- Returns: A new WebRule instance created from the JSON representation.\r\n\r\nNote: This method is static and does not require an existing instance of the class.\r\n\r\n## Class: WebFields\r\n\r\nRepresents a collection of web fields with their properties and methods. Extends the WebRetrieveItem class.\r\n\r\n### Constructor\r\n\r\n#### WebFields(id: string)\r\n\r\nCreates a new instance of the WebFields class with the specified `id`.\r\n\r\n- `id` (string): The unique identifier for the web fields.\r\n\r\n### Properties\r\n\r\n- Inherited from WebRetrieveItem:\r\n  - `id` (string): The unique identifier for the web fields.\r\n  - `steps` (array): An array of WebRetrieveMethod instances representing the steps to retrieve the item.\r\n  - `source` (WebRetrieveItem|null): The source WebRetrieveItem instance from which to retrieve the item.\r\n  - `debug` (object): Debug information associated with the web fields.\r\n  - `retrieved` (boolean): A flag indicating whether the item has been retrieved or not.\r\n  - `sourceValue` (any|null): The value retrieved from the source.\r\n  - `value` (any|null): The final retrieved value.\r\n  - `type` (string): The type of the web fields.\r\n\r\n- `items` (object): An object representing the collection of web field items. Each item is identified by its unique `id`.\r\n- `confidence` (number): The confidence level associated with the web fields.\r\n\r\n### Methods\r\n\r\n#### setConfidence(confidence: number)\r\n\r\nSets the confidence level for the web fields.\r\n\r\n- `confidence` (number): The confidence level to set.\r\n\r\n#### addFieldItem(item: WebFieldItem)\r\n\r\nAdds a WebFieldItem instance to the collection of web fields.\r\n\r\n- `item` (WebFieldItem): The WebFieldItem instance to add.\r\n\r\n#### toJSON(): object\r\n\r\nSerializes the web fields object to a JSON representation.\r\n\r\n- Returns: An object representing the serialized web fields.\r\n\r\n#### static fromJSON(fieldJSON: object): WebFields\r\n\r\nCreates a new WebFields instance from a JSON representation.\r\n\r\n- `fieldJSON` (object): The JSON representation of the web fields.\r\n\r\n- Returns: A new WebFields instance created from the JSON representation.\r\n\r\nNote: This method is static and does not require an existing instance of the class.\r\n\r\n#### run(): array\r\n\r\nExecutes the retrieval process for the web fields by running the associated steps on the source value.\r\n\r\n- Returns: An array of field objects containing the retrieved values for each field.\r\n\r\nNote: The retrieval process considers the source value, source items, and field items to generate the fields.\r\n\r\n## Class: WebFieldItem\r\n\r\nRepresents a single web field item with its properties and methods. Extends the WebRetrieveItem class.\r\n\r\n### Constructor\r\n\r\n#### WebFieldItem(id: string)\r\n\r\nCreates a new instance of the WebFieldItem class with the specified `id`.\r\n\r\n- `id` (string): The unique identifier for the web field item.\r\n\r\n### Properties\r\n\r\n- Inherited from WebRetrieveItem:\r\n  - `id` (string): The unique identifier for the web field item.\r\n  - `steps` (array): An array of WebRetrieveMethod instances representing the steps to retrieve the item.\r\n  - `source` (WebRetrieveItem|null): The source WebRetrieveItem instance from which to retrieve the item.\r\n  - `debug` (object): Debug information associated with the web field item.\r\n  - `retrieved` (boolean): A flag indicating whether the item has been retrieved or not.\r\n  - `sourceValue` (any|null): The value retrieved from the source.\r\n  - `value` (any|null): The final retrieved value.\r\n  - `type` (string): The type of the web field item.\r\n\r\n### Methods\r\n\r\n#### static fromJSON(json: object): WebFieldItem\r\n\r\nCreates a new WebFieldItem instance from a JSON representation.\r\n\r\n- `json` (object): The JSON representation of the web field item.\r\n\r\n- Returns: A new WebFieldItem instance created from the JSON representation.\r\n\r\nNote: This method is static and does not require an existing instance of the class.\r\n\r\n#### run(value: any): any\r\n\r\nExecutes the retrieval process for the web field item by running the associated steps on the provided value.\r\n\r\n- `value` (any): The value on which to run the retrieval steps.\r\n\r\n- Returns: The retrieved value after running the steps.\r\n\r\nNote: The retrieval process considers the provided value and the associated steps to generate the retrieved value.\r\n\r\n## Class: WebRetrieveItem\r\n\r\nRepresents a web retrieve item with its properties and methods.\r\n\r\n### Constructor\r\n\r\n#### WebRetrieveItem(id: string)\r\n\r\nCreates a new instance of the WebRetrieveItem class with the specified `id`.\r\n\r\n- `id` (string): The unique identifier for the web retrieve item.\r\n\r\n### Properties\r\n\r\n- `id` (string): The unique identifier for the web retrieve item.\r\n- `steps` (array): An array of WebRetrieveMethod instances representing the steps to retrieve the item.\r\n- `source` (WebRetrieveItem|null): The source WebRetrieveItem instance from which to retrieve the item.\r\n- `debug` (object): Debug information associated with the web retrieve item.\r\n- `retrieved` (boolean): A flag indicating whether the item has been retrieved or not.\r\n- `sourceValue` (any|null): The value retrieved from the source.\r\n- `value` (any|null): The final retrieved value.\r\n- `type` (string): The type of the web retrieve item.\r\n\r\n### Methods\r\n\r\n#### setType(type: string)\r\n\r\nSets the type of the web retrieve item.\r\n\r\n- `type` (string): The type to set for the web retrieve item.\r\n\r\n#### setRetrieved(flag: boolean = true)\r\n\r\nSets the retrieved flag indicating whether the item has been retrieved or not.\r\n\r\n- `flag` (boolean): The flag value. Default is `true`.\r\n\r\n#### setSource(source: WebRetrieveItem|null)\r\n\r\nSets the source WebRetrieveItem instance from which to retrieve the item.\r\n\r\n- `source` (WebRetrieveItem|null): The source WebRetrieveItem instance.\r\n\r\n#### setSourceValue(sourceValue: any)\r\n\r\nSets the source value and updates the debug information.\r\n\r\n- `sourceValue` (any): The source value to set.\r\n\r\n#### retrieveFromSource()\r\n\r\nRetrieves the value from the source WebRetrieveItem instance and sets the source value and retrieved flag.\r\n\r\n#### addSteps(steps: WebRetrieveMethod)\r\n\r\nAdds a WebRetrieveMethod instance to the steps for retrieving the item.\r\n\r\n- `steps` (WebRetrieveMethod): The WebRetrieveMethod instance to add.\r\n\r\n#### toJSON(): object\r\n\r\nSerializes the web retrieve item object to a JSON representation.\r\n\r\n- Returns: An object representing the serialized web retrieve item.\r\n\r\n#### runSteps(sourceValue: any): any\r\n\r\nExecutes the steps of retrieving the item by sequentially running each WebRetrieveMethod.\r\n\r\n- `sourceValue` (any): The source value to start with.\r\n\r\n- Returns: The final retrieved value.\r\n\r\n#### run(): any\r\n\r\nExecutes the retrieval process by retrieving the item from the source and running the steps if necessary.\r\n\r\n- Returns: The final retrieved value.\r\n\r\n#### static fromJSON(json: object): WebRetrieveItem\r\n\r\nCreates a new WebRetrieveItem instance from a JSON representation.\r\n\r\n- `json` (object): The JSON representation of the web retrieve item.\r\n\r\n- Returns: A new WebRetrieveItem instance created from the JSON representation.\r\n\r\nNote: This method is static and does not require an existing instance of the class.\r\n\r\n## Class: WebRetrieveMethod\r\n\r\nRepresents a web retrieve method with its properties and methods.\r\n\r\n### Constructor\r\n\r\n#### WebRetrieveMethod()\r\n\r\nCreates a new instance of the WebRetrieveMethod class.\r\n\r\n### Properties\r\n\r\n- `type` (string): The type of the web retrieve method.\r\n- `parameters` (object): The parameters associated with the web retrieve method.\r\n- `method` (string): The method used for retrieval.\r\n- `debug` (object): Debug information associated with the web retrieve method.\r\n- `classInstance` (string): The class instance identifier.\r\n\r\n### Methods\r\n\r\n#### setMethod(method: string)\r\n\r\nSets the method used for retrieval.\r\n\r\n- `method` (string): The method used for retrieval.\r\n\r\n#### setParameter(key: string, value: any)\r\n\r\nSets a parameter value for the specified key.\r\n\r\n- `key` (string): The key of the parameter.\r\n- `value` (any): The value to set for the specified key.\r\n\r\n#### getParameter(key: string): any\r\n\r\nRetrieves the value of a parameter for the specified key.\r\n\r\n- `key` (string): The key of the parameter.\r\n\r\n- Returns: The value of the parameter.\r\n\r\n#### run(item: any): any\r\n\r\nExecutes the web retrieve method by processing the provided item.\r\n\r\n- `item` (any): The item to be processed by the method.\r\n\r\n- Returns: The processed item.\r\n\r\n#### fromJSON(stepJSON: object)\r\n\r\nPopulates the WebRetrieveMethod instance from a JSON representation.\r\n\r\n- `stepJSON` (object): The JSON representation of the web retrieve method.\r\n\r\n#### toJSON(): object\r\n\r\nSerializes the web retrieve method object to a JSON representation.\r\n\r\n- Returns: An object representing the serialized web retrieve method.\r\n\r\n## Class: WebStructure\r\n\r\nRepresents a web structure with its properties and methods. Extends the WebRetrieveItem class.\r\n\r\n### Constructor\r\n\r\n#### WebStructure(id: string)\r\n\r\nCreates a new instance of the WebStructure class with the specified `id`.\r\n\r\n- `id` (string): The unique identifier for the web structure.\r\n\r\n### Properties\r\n\r\n- Inherited from WebRetrieveItem:\r\n  - `id` (string): The unique identifier for the web structure.\r\n  - `steps` (array): An array of WebRetrieveMethod instances representing the steps to retrieve the item.\r\n  - `source` (WebRetrieveItem|null): The source WebRetrieveItem instance from which to retrieve the item.\r\n  - `debug` (object): Debug information associated with the web structure.\r\n  - `retrieved` (boolean): A flag indicating whether the item has been retrieved or not.\r\n  - `sourceValue` (any|null): The value retrieved from the source.\r\n  - `value` (any|null): The final retrieved value.\r\n  - `type` (string): The type of the web structure.\r\n\r\n### Methods\r\n\r\n#### fromJSON(structureJSON: object): WebStructure\r\n\r\nCreates a new WebStructure instance from a JSON representation.\r\n\r\n- `structureJSON` (object): The JSON representation of the web structure.\r\n\r\n- Returns: A new WebStructure instance created from the JSON representation.\r\n\r\nNote: This method is static and does not require an existing instance of the class.\r\n\r\n## Web Data Retrieval Methods\r\n\r\nThis project provides a set of classes that implement various web data retrieval methods. These methods are designed to extract specific content from web documents based on different criteria. The classes are implemented in JavaScript and extend the `WebRetrieveMethod` class, which provides common functionality for data retrieval.\r\n\r\n## WebRetrieveMethod\r\n\r\nThis is the base class for all web data retrieval methods. It contains shared functionality and properties.\r\n\r\n### Constructor\r\n\r\n- **No Arguments:** Creates an instance of the `WebRetrieveMethod` class.\r\n\r\n### Methods\r\n\r\n- `setMethod(method)`: Sets the method identifier for the retrieval process.\r\n\r\n- `setParameter(name, value)`: Sets a parameter used by the retrieval method.\r\n\r\n- `run(content)`: The main method responsible for extracting data from the web content. It takes the web content as input and returns the extracted data.\r\n\r\n## RetriveByDocumentTextContent\r\n\r\nThis class retrieves data by directly accessing the text content of a web document.\r\n\r\n### Constructor\r\n\r\n- **No Arguments:** Creates an instance of the `RetriveByDocumentTextContent` class.\r\n\r\n### Methods\r\n\r\n- `run(documentNode)`: Takes a DOM element `documentNode` as input, and extracts the text content from it using the `textContent` property. It then passes the text content to the parent class's `run` method for further processing.\r\n\r\n## RetriveByDocumentGetAttribute\r\n\r\nThis class retrieves data by accessing a specific attribute of a web document.\r\n\r\n### Constructor\r\n\r\n- `attribute`: The attribute name to retrieve data from.\r\n\r\n### Methods\r\n\r\n- `run(documentNode)`: Takes a DOM element `documentNode` as input, retrieves the value of the specified attribute using the `getAttribute` method, and passes it to the parent class's `run` method for further processing.\r\n\r\n## RetriveByDocumentParsedTextContent\r\n\r\nThis class retrieves data by parsing the inner HTML of a web document and extracting text content.\r\n\r\n### Constructor\r\n\r\n- **No Arguments:** Creates an instance of the `RetriveByDocumentParsedTextContent` class.\r\n\r\n### Methods\r\n\r\n- `run(documentNode)`: Takes a DOM element `documentNode` as input, parses its inner HTML, removes HTML tags, and returns the resulting text content to the parent class's `run` method for further processing.\r\n\r\n## RetriveByVisibleElement\r\n\r\nThis class retrieves data from a visible web element by checking its visibility and dimensions.\r\n\r\n### Constructor\r\n\r\n- **No Arguments:** Creates an instance of the `RetriveByVisibleElement` class.\r\n\r\n### Methods\r\n\r\n- `run(documentNode)`: Takes a DOM element `documentNode` as input, checks its visibility and dimensions, and returns the element itself if it is visible, or `null` if it is hidden, to the parent class's `run` method for further processing.\r\n\r\n## RetriveByTextSplit\r\n\r\nThis class retrieves data by splitting a text content using a specified delimiter.\r\n\r\n### Constructor\r\n\r\n- `splitby`: The delimiter to split the text content.\r\n\r\n### Methods\r\n\r\n- `run(content)`: Takes the text content as input, splits it using the specified delimiter, and returns an array of the resulting segments to the parent class's `run` method for further processing.\r\n\r\n## RetriveByRegEx\r\n\r\nThis class retrieves data by matching a regular expression pattern in the text content.\r\n\r\n### Constructor\r\n\r\n- `regex`: The regular expression pattern to match.\r\n\r\n### Methods\r\n\r\n- `run(content)`: Takes the text content as input, matches it against the specified regular expression, and returns an array of matched results to the parent class's `run` method for further processing.\r\n\r\n## RetriveByFromArray\r\n\r\nThis class retrieves data from an array by accessing a specific index.\r\n\r\n### Constructor\r\n\r\n- `index`: The index of the element to retrieve from the array.\r\n\r\n### Methods\r\n\r\n- `run(content)`: Takes an array `content` as input, retrieves the element at the specified index, and returns it to the parent class's `run` method for further processing.\r\n\r\n## RetriveByStringTrim\r\n\r\nThis class retrieves data by trimming whitespace from a string.\r\n\r\n### Constructor\r\n\r\n- **No Arguments:** Creates an instance of the `RetriveByStringTrim` class.\r\n\r\n### Methods\r\n\r\n- `run(content)`: Takes a string `content` as input, trims leading and trailing whitespace from it, and returns the trimmed string to the parent class's `run` method for further processing.\r\n\r\n\r\n## Constants: XPathResultType\r\n\r\nA collection of constants representing different XPath result types.\r\n\r\n- `ANY_TYPE` (number): Represents any type of result.\r\n- `NUMBER_TYPE` (number): Represents a number result.\r\n- `STRING_TYPE` (number): Represents a string result.\r\n- `BOOLEAN_TYPE` (number): Represents a boolean result.\r\n- `UNORDERED_NODE_ITERATOR_TYPE` (number): Represents an unordered node iterator result.\r\n- `ORDERED_NODE_ITERATOR_TYPE` (number): Represents an ordered node iterator result.\r\n- `UNORDERED_NODE_SNAPSHOT_TYPE` (number): Represents an unordered node snapshot result.\r\n- `ORDERED_NODE_SNAPSHOT_TYPE` (number): Represents an ordered node snapshot result.\r\n- `ANY_UNORDERED_NODE_TYPE` (number): Represents any unordered node result.\r\n- `FIRST_ORDERED_NODE_TYPE` (number): Represents the first ordered node result.\r\n\r\n---\r\n\r\n## Class: RetriveByXpath\r\n\r\nRepresents a web retrieval method that uses XPath expressions to select nodes from an XML or HTML document. Extends the WebRetrieveMethod class.\r\n\r\n### Constructor\r\n\r\n#### RetriveByXpath(xpathExpression: string)\r\n\r\nCreates a new instance of the RetriveByXpath class with the specified XPath expression.\r\n\r\n- `xpathExpression` (string): The XPath expression used for node selection.\r\n\r\n### Properties\r\n\r\n- Inherited from WebRetrieveMethod:\r\n  - `type` (string): The type of the web retrieval method.\r\n  - `parameters` (object): A dictionary of parameters for the retrieval method.\r\n  - `method` (string): The specific retrieval method.\r\n  - `debug` (object): Debug information associated with the retrieval method.\r\n  - `classInstance` (string): The class instance identifier.\r\n\r\n### Methods\r\n\r\n#### setExpression(xpathExpression: string): void\r\n\r\nSets the XPath expression used for node selection.\r\n\r\n- `xpathExpression` (string): The XPath expression to set.\r\n\r\n#### setNamespaceResolver(namespaceResolver: any): void\r\n\r\nSets the namespace resolver for the XPath expression.\r\n\r\n- `namespaceResolver` (any): The namespace resolver to set.\r\n\r\n#### setResultType(resultType: number): void\r\n\r\nSets the result type for the XPath expression.\r\n\r\n- `resultType` (number): The result type to set. Should be one of the constants defined in XPathResultType.\r\n\r\n#### run(contextNode?: Node): any\r\n\r\nExecutes the retrieval process by evaluating the XPath expression and selecting nodes from the provided context node.\r\n\r\n- `contextNode` (Node): The context node from which to evaluate the XPath expression. If not specified, the document node will be used as the context.\r\n\r\n- Returns: The retrieved nodes or the result of running the retrieved nodes through the superclass's `run` method, depending on the result type.\r\n\r\n---\r\n\r\n## Class: RetriveByXpathSingleNode\r\n\r\nRepresents a web retrieval method that uses XPath expressions to select a single node from an XML or HTML document. Extends the RetriveByXpath class.\r\n\r\n### Constructor\r\n\r\n#### RetriveByXpathSingleNode(xpathExpression: string)\r\n\r\nCreates a new instance of the RetriveByXpathSingleNode class with the specified XPath expression.\r\n\r\n- `xpathExpression` (string): The XPath expression used for node selection.\r\n\r\n### Properties\r\n\r\n- Inherited from RetriveByXpath:\r\n  - `type` (string): The type of the web retrieval method.\r\n  - `parameters` (object): A dictionary of parameters for the retrieval method.\r\n  - `method` (string): The specific retrieval method.\r\n  - `debug` (object): Debug information associated with the retrieval method.\r\n  - `classInstance` (string): The class instance identifier.\r\n\r\n### Methods\r\n\r\n- Inherits all methods from the RetriveByXpath class.\r\n\r\n---\r\n\r\n## Class: RetriveBy\r\n\r\nXpathMultipleNodes\r\n\r\nRepresents a web retrieval method that uses XPath expressions to select multiple nodes from an XML or HTML document. Extends the RetriveByXpath class.\r\n\r\n### Constructor\r\n\r\n#### RetriveByXpathMultipleNodes(xpathExpression: string)\r\n\r\nCreates a new instance of the RetriveByXpathMultipleNodes class with the specified XPath expression.\r\n\r\n- `xpathExpression` (string): The XPath expression used for node selection.\r\n\r\n### Properties\r\n\r\n- Inherited from RetriveByXpath:\r\n  - `type` (string): The type of the web retrieval method.\r\n  - `parameters` (object): A dictionary of parameters for the retrieval method.\r\n  - `method` (string): The specific retrieval method.\r\n  - `debug` (object): Debug information associated with the retrieval method.\r\n  - `classInstance` (string): The class instance identifier.\r\n\r\n### Methods\r\n\r\n- Inherits all methods from the RetriveByXpath class.\r\n\r\n## Web Data Retrieval Methods - Query Selector\r\n\r\nThis project provides two classes that implement web data retrieval methods based on the query selector expressions. These methods allow users to specify elements on a web page using CSS-like selectors and retrieve specific content from those elements. The classes are implemented in JavaScript and extend the `WebRetrieveMethod` class, which provides common functionality for data retrieval.\r\n\r\n## WebRetrieveMethod\r\n\r\nThis is the base class for all web data retrieval methods. It contains shared functionality and properties.\r\n\r\n### Constructor\r\n\r\n- **No Arguments:** Creates an instance of the `WebRetrieveMethod` class.\r\n\r\n### Methods\r\n\r\n- `setMethod(method)`: Sets the method identifier for the retrieval process.\r\n\r\n- `setParameter(name, value)`: Sets a parameter used by the retrieval method.\r\n\r\n- `run(content)`: The main method responsible for extracting data from the web content. It takes the web content as input and returns the extracted data.\r\n\r\n## RetriveByQuerySelector\r\n\r\nThis class retrieves data by using the `querySelector` method to select a single element on the web page.\r\n\r\n### Constructor\r\n\r\n- `selectorExpression`: The CSS-like selector expression to identify the target element.\r\n\r\n### Methods\r\n\r\n- `run(contextNode)`: Takes a DOM element `contextNode` as input (optional, defaults to the `document`), uses the `querySelector` method with the specified selector expression to find the target element, and returns the element itself if found or `null` if not found to the parent class's `run` method for further processing.\r\n\r\n## RetriveByQuerySelectorAll\r\n\r\nThis class retrieves data by using the `querySelectorAll` method to select multiple elements on the web page.\r\n\r\n### Constructor\r\n\r\n- `selectorExpression`: The CSS-like selector expression to identify the target elements.\r\n\r\n### Methods\r\n\r\n- `run(contextNode)`: Takes a DOM element `contextNode` as input (optional, defaults to the `document`), uses the `querySelectorAll` method with the specified selector expression to find all matching elements, and returns an array of matched elements to the parent class's `run` method for further processing.\r\n\r\n---\r\n\r\nPlease note that the above documentation provides an overview of the classes and their methods' functionalities. For the actual implementation and usage of these classes, you would need to see the complete code and how it is integrated into the web data retrieval system.\r\n\r\n### Example\r\n\r\n```javascript\r\n// Create retrieval methods\r\nconst retriveTxtContent = new RetriveByDocumentTextContent();\r\nconst retriveuserListBody = new RetriveByXpathSingleNode('//*[@id=\"id_user_list_body\"]');\r\nconst retrieveuserRows = new RetriveByXpathMultipleNodes('//tr[@class=\"clickable\"]');\r\nconst retriveName = new RetriveByXpathSingleNode('td[2]');\r\n\r\n// Create web structures\r\nconst userInfoStructure = new WebStructure(\"user\");\r\nuserInfoStructure.addSteps(retriveuserListBody);\r\nuserInfoStructure.addSteps(retrieveuserRows);\r\n\r\n// Create field items\r\nconst fnameFieldItem = new WebFieldItem('fname');\r\nfnameFieldItem.addSteps(new RetriveByXpathSingleNode('td[3]'));\r\nfnameFieldItem.addSteps(retriveTxtContent);\r\n\r\nconst lnameFieldItem = new WebFieldItem('lname');\r\nlnameFieldItem.addSteps(new RetriveByXpathSingleNode('td[2]'));\r\nlnameFieldItem.addSteps(retriveTxtContent);\r\n\r\n// Create web fields\r\nconst nameGenderDOBFields = new WebFields('name-dob-gender');\r\nnameGenderDOBFields.setSource(userInfoStructure);\r\nnameGenderDOBFields.addFieldItem(fnameFieldItem);\r\nnameGenderDOBFields.addFieldItem(lnameFieldItem);\r\n\r\n// Create field items for user header info\r\nconst fullname = new WebFieldItem('fullname');\r\nfullname.addSteps(new RetriveByRegEx(\"([^\\s]+) \\\\([^)]+\\\\)\"));\r\nfullname.addSteps(new RetriveByFromArray(1));\r\nfullname.addSteps(new RetriveByStringTrim());\r\n\r\nconst gender = new WebFieldItem('gender');\r\ngender.addSteps(new RetriveByRegEx(\"\\\\(\\\\s*(Male|Female|Other|Unknown|Declined to Specify)\\\\s*\\\\|\"));\r\ngender.addSteps(new RetriveByFromArray(1));\r\ngender.addSteps(new RetriveByStringTrim());\r\n\r\nconst dob = new WebFieldItem('dob');\r\ndob.addSteps(new RetriveByRegEx(\"/(\\w+ \\d{1,2}, \\d{4})/\"));\r\ndob.addSteps(new RetriveByFromArray(1));\r\ndob.addSteps(new RetriveByStringTrim());\r\n\r\n// Create web fields for user header info\r\nconst nogdF = new WebFields('nogd');\r\nnogdF.setSource(userHeaderInfoStructure);\r\nnogdF.addFieldItem(fullname);\r\nnogdF.addFieldItem(gender);\r\n\r\n// Create web scraping rule\r\nconst scrapRule = new WebRule(\"23232\");\r\nscrapRule.version = 3;\r\nscrapRule.addStructure(userInfoStructure);\r\nscrapRule.addStructure(userHeaderInfoStructure);\r\nscrapRule.addFields(nameGenderDOBFields);\r\nscrapRule.addFields(nogdF);\r\n\r\n// Run the web scraping rule\r\nscrapRule.run();\r\n```\r\n\r\nThis example demonstrates the usage of various web retrieval methods, web structures, field items, web fields, and a web scraping rule to retrieve and extract data from a web page. The retrieved data can be further processed or used as needed.","readmeFilename":"readme.md"}