Skip to content

Commit bca1514

Browse files
committed
example and explaination updated
1 parent 115883d commit bca1514

31 files changed

+226
-41
lines changed

docs/api/browser/click.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data:
2121
<CBBaseInfo/>
2222
<CBParameters/>
2323

24-
### Examples
24+
### Example
2525

2626
```js
2727
// Using Codebolt's browser API, you can interact with elements on a web page.

docs/api/browser/close.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ data:
1616
<CBBaseInfo/>
1717
<CBParameters/>
1818

19-
### Examples
20-
```js
19+
### Example
20+
21+
```js
2122
// Open the browser and navigate to a specific URL
22-
codebolt.browser.goToPage(url);
23+
codebolt.browser.goToPage(url);
2324

2425
// Perform tests on the web page
2526
// (Assume you have performed all necessary tests)
2627

2728
// Close the current page
28-
codebolt.browser.close();
29+
codebolt.browser.close();
2930

3031
```
3132
### Explaination

docs/api/browser/enter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data:
1818
<CBBaseInfo/>
1919
<CBParameters/>
2020

21-
### Examples
21+
### Example
2222

2323
```js
2424

docs/api/browser/extractText.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data:
1616
<CBBaseInfo/>
1717
<CBParameters/>
1818

19-
### Examples:
19+
### Example
2020

2121
```js
2222
// Navigate to the news website

docs/api/browser/getContent.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,22 @@ data:
2020
### Status
2121
Working Progress...
2222

23+
24+
### Example
25+
26+
```js
27+
28+
// Navigate to the product page
29+
await codebolt.browser.goToPage("https://example-ecommerce.com/product/12345")
30+
31+
// Retrieve the get content of the current page
32+
const getContent = await codebolt.browser.getContent()
33+
34+
console.log(getContent)
35+
36+
```
37+
38+
39+
### Explaination
40+
41+
The codebolt.browser.getContent() method is used to capture the entire content of the webpage that is currently loaded. This includes the HTML, text, and other elements present on the page. The codebolt.browser.getContent() function is used to retrieve the HTML content of the current web page. This function is particularly useful for web scraping, data extraction, and automated testing scenarios where you need to capture the content of a web page for further analysis or processing.

docs/api/browser/getHTML.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data:
1919
<CBParameters/>
2020

2121

22-
### Examples :
22+
### Example
2323

2424
```js
2525

docs/api/browser/getMarkdown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data:
1818
<CBBaseInfo/>
1919
<CBParameters/>
2020

21-
### Examples:
21+
### Example
2222

2323
```js
2424

docs/api/browser/getPDF.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,19 @@ data:
2020
### Status
2121
Working Progress...
2222

23+
24+
### Example
25+
26+
```js
27+
28+
29+
await codebolt.browser.goToPage("https://example-ecommerce.com/product/12345")
30+
31+
32+
const getPDF = await codebolt.browser.getPDF()
33+
34+
```
35+
36+
### Explaination
37+
38+
The codebolt.browser.getPDF() method is designed to capture the content of the current webpage and generate a PDF file from it. This is useful for saving web pages as PDFs for offline reading, documentation, or record-keeping.

docs/api/browser/getUrl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ data:
1919
<CBParameters/>
2020

2121

22-
### Examples:
22+
### Example
2323

2424
```js
2525

docs/api/browser/goToPage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data:
2121
<CBBaseInfo/>
2222
<CBParameters/>
2323

24-
### Examples
24+
### Example
2525

2626
```js
2727

0 commit comments

Comments
 (0)