Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Updated to the example to latest test.js
  • Loading branch information
DemonMartin committed Jun 15, 2023
1 parent 2b2c2a8 commit 380223c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ const scrappey = new Scrappey('YOUR_API_KEY');
Here's an example of how to use Scrappey. 🚀

```javascript
const Scrappey = require('scrappey');
const Scrappey = require('.');

// Replace 'YOUR_API_KEY' with your Scrappey API key
const apiKey = 'YOUR_API_KEY';
const apiKey = '';

// Create an instance of Scrappey
const scrappey = new Scrappey(apiKey);
Expand All @@ -51,15 +51,15 @@ async function runTest() {
// Create a session
const session = await scrappey.createSession();

console.log('Session created:', session);
console.log(session)

// Make a GET request
const getRequestResult = await scrappey.getRequest('https://example.com', session.sessionId);
const getRequestResult = await scrappey.getRequest('https://reqres.in/api/users', session.sessionId);
console.log('GET Request Result:', getRequestResult);

// Make a POST request
const postData = { username: 'user123', password: 'pass456' };
const postRequestResult = await scrappey.postRequest('https://example.com/login', postData, session.sessionId);
const postRequestResult = await scrappey.postRequest('https://reqres.in/api/users', postData, session.sessionId);
console.log('POST Request Result:', postRequestResult);

// Destroy the session
Expand All @@ -71,6 +71,7 @@ async function runTest() {
}

runTest();

```

## License
Expand Down

0 comments on commit 380223c

Please sign in to comment.