@xcrap/got-scraping-client 0.0.5 → 0.1.0

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.
Files changed (2) hide show
  1. package/README.md +5 -5
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -7,10 +7,10 @@
7
7
  There are no secrets to installing it, just use your favorite dependency manager. Here is an example using NPM:
8
8
 
9
9
  ```cmd
10
- npm i @xcrap/got-scraping-client @xcrap/core @xcrap/parser
10
+ npm i @xcrap/got-scraping-client @xcrap/core @xcrap/extractor
11
11
  ```
12
12
 
13
- > You need to install `@xcrap/parser` and `@xcrap/core` as well because I left them as `peerDependencies`, which means that the package needs `@xcrap/parser` and `@xcrap/core` as dependencies, however, the ones that the user has installed in the project will be used.
13
+ > You need to install `@xcrap/extractor` and `@xcrap/core` as well because I left them as `peerDependencies`, which means that the package needs `@xcrap/extractor` and `@xcrap/core` as dependencies, however, the ones that the user has installed in the project will be used.
14
14
 
15
15
  ## 🚀 Usage
16
16
 
@@ -18,14 +18,14 @@ Like any HTTP client, `GotScrapingClient` has two methods: `fetch()` to make a r
18
18
 
19
19
  ```ts
20
20
  import { GotScrapingClient } from "@xcrap/got-scraping-client"
21
- import { extract } from "@xcrap/parser"
21
+ import { extract, css } from "@xcrap/extractor"
22
22
 
23
23
  ;(async() => {
24
24
  const client = new GotScrapingClient()
25
25
  const url = "https://example.com"
26
26
  const response = await client.fetch({ url: url })
27
27
  const parser = response.asHtmlParser()
28
- const pageTitle = await parser.parseFist({ query: "title", extractor: extract("innerText") })
28
+ const pageTitle = await parser.extractValue({ query: css("title"), extractor: extract("innerText") })
29
29
 
30
30
  console.log("Page Title:", pageTitle)
31
31
  })();
@@ -124,4 +124,4 @@ const client = new GotScrapingClient({ proxyUrl: randomProxyUrl })
124
124
 
125
125
  ## 📝 License
126
126
 
127
- This project is licensed under the MIT License.
127
+ This project is licensed under the MIT License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcrap/got-scraping-client",
3
- "version": "0.0.5",
3
+ "version": "0.1.0",
4
4
  "description": "Xcrap Got Scraping Client is a package of the Xcrap framework that implements an HTTP client using the Got Scraping library.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -23,18 +23,18 @@
23
23
  "license": "MIT",
24
24
  "type": "commonjs",
25
25
  "devDependencies": {
26
- "@types/node": "^22.13.17",
27
- "header-generator": "^2.1.63",
26
+ "@types/node": "^25.2.3",
27
+ "header-generator": "^2.1.80",
28
28
  "ts-node": "^10.9.2",
29
- "typescript": "^5.8.2"
29
+ "typescript": "^5.9.3"
30
30
  },
31
31
  "dependencies": {
32
- "got-scraping": "^4.1.1",
33
- "load-esm": "^1.0.2"
32
+ "got-scraping": "^4.1.3",
33
+ "load-esm": "^1.0.3"
34
34
  },
35
35
  "peerDependencies": {
36
- "@xcrap/core": "*",
37
- "@xcrap/parser": "*"
36
+ "@xcrap/core": "^0.2.3",
37
+ "@xcrap/extractor": "^0.3.1"
38
38
  },
39
39
  "repository": {
40
40
  "type": "git",