Skip to content

Commit 851ede6

Browse files
committed
update readme
1 parent f5a1dda commit 851ede6

File tree

3 files changed

+86
-20
lines changed

3 files changed

+86
-20
lines changed

readme.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,61 @@ scrappey_instance = scrappey.Scrappey(api_key)
4141
Here's an example of how to use Scrappey. 🚀
4242

4343
```python
44-
from scrappeycom.scrappey import Scrappey
44+
from scrappey import Scrappey
45+
import uuid
4546

4647
scrappey = Scrappey('API_KEY')
4748

4849
def run_test():
4950
try:
50-
session = scrappey.create_session()
51-
print(session)
52-
53-
get_request_result = scrappey.get_request('https://httpbin.rs/get', session['session'])
51+
sessionData = {
52+
'session': str(uuid.uuid4()), #uuid is also optional, otherwise default uuid will be used
53+
#'proxy': 'http://username:password@ip:port' #proxy is optional, otherwise default proxy will be used
54+
}
55+
session = scrappey.create_session(sessionData)
56+
print('Session created:', session['session'])
57+
58+
# View all the options here with the request builder
59+
# https://app.scrappey.com/#/builder
60+
# Just copy paste it below, example
61+
#
62+
# {
63+
# "cmd": "request.get",
64+
# "url": "https://httpbin.rs/get"
65+
# }
66+
67+
get_request_result = scrappey.request({
68+
"cmd": "request.get",
69+
'session': session['session'],
70+
'url': 'https://httpbin.rs/get',
71+
})
5472
print('GET Request Result:', get_request_result)
5573

56-
post_data = {'username': 'user123', 'password': 'pass456'}
57-
post_request_result = scrappey.post_request('https://httpbin.rs/post', post_data, session['session'])
74+
post_request_result = scrappey.request({
75+
"cmd": "request.post",
76+
"url": "https://httpbin.rs/post",
77+
"postData": "test=test&test2=test2"
78+
})
5879
print('POST Request Result:', post_request_result)
5980

60-
scrappey.destroy_session(session['session'])
61-
print('Session destroyed.')
81+
# JSON request example
82+
post_request_result_json = scrappey.request({
83+
"cmd": "request.post",
84+
"url": "https://backend.scrappey.com/api/auth/login",
85+
"postData": "{\"email\":\"email\",\"password\":\"password\"}",
86+
"customHeaders": {
87+
"content-type": "application/json"
88+
}
89+
})
90+
print('POST Request Result:', post_request_result_json)
91+
92+
sessionDestroyed = scrappey.destroy_session(sessionData)
93+
print('Session destroyed:', sessionDestroyed)
6294
except Exception as error:
6395
print(error)
6496

6597
run_test()
98+
6699
```
67100

68101
For more information, please visit the [official Scrappey documentation](https://wiki.scrappey.com/getting-started). 📚

scrappeycom.egg-info/PKG-INFO

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: scrappeycom
3-
Version: 0.3.4
3+
Version: 0.3.6
44
Summary: An API wrapper for Scrappey.com written in Python (cloudflare bypass & solver)
55
Home-page: https://github.com/pim97/scrappey-wrapper-python
66
Download-URL: https://github.com/pim97/scrappey-wrapper-python/releases/tag/v_03
@@ -62,28 +62,61 @@ scrappey_instance = scrappey.Scrappey(api_key)
6262
Here's an example of how to use Scrappey. 🚀
6363

6464
```python
65-
from scrappeycom.scrappey import Scrappey
65+
from scrappey import Scrappey
66+
import uuid
6667

6768
scrappey = Scrappey('API_KEY')
6869

6970
def run_test():
7071
try:
71-
session = scrappey.create_session()
72-
print(session)
73-
74-
get_request_result = scrappey.get_request('https://httpbin.rs/get', session['session'])
72+
sessionData = {
73+
'session': str(uuid.uuid4()), #uuid is also optional, otherwise default uuid will be used
74+
#'proxy': 'http://username:password@ip:port' #proxy is optional, otherwise default proxy will be used
75+
}
76+
session = scrappey.create_session(sessionData)
77+
print('Session created:', session['session'])
78+
79+
# View all the options here with the request builder
80+
# https://app.scrappey.com/#/builder
81+
# Just copy paste it below, example
82+
#
83+
# {
84+
# "cmd": "request.get",
85+
# "url": "https://httpbin.rs/get"
86+
# }
87+
88+
get_request_result = scrappey.request({
89+
"cmd": "request.get",
90+
'session': session['session'],
91+
'url': 'https://httpbin.rs/get',
92+
})
7593
print('GET Request Result:', get_request_result)
7694

77-
post_data = {'username': 'user123', 'password': 'pass456'}
78-
post_request_result = scrappey.post_request('https://httpbin.rs/post', post_data, session['session'])
95+
post_request_result = scrappey.request({
96+
"cmd": "request.post",
97+
"url": "https://httpbin.rs/post",
98+
"postData": "test=test&test2=test2"
99+
})
79100
print('POST Request Result:', post_request_result)
80101

81-
scrappey.destroy_session(session['session'])
82-
print('Session destroyed.')
102+
# JSON request example
103+
post_request_result_json = scrappey.request({
104+
"cmd": "request.post",
105+
"url": "https://backend.scrappey.com/api/auth/login",
106+
"postData": "{\"email\":\"email\",\"password\":\"password\"}",
107+
"customHeaders": {
108+
"content-type": "application/json"
109+
}
110+
})
111+
print('POST Request Result:', post_request_result_json)
112+
113+
sessionDestroyed = scrappey.destroy_session(sessionData)
114+
print('Session destroyed:', sessionDestroyed)
83115
except Exception as error:
84116
print(error)
85117

86118
run_test()
119+
87120
```
88121

89122
For more information, please visit the [official Scrappey documentation](https://wiki.scrappey.com/getting-started). 📚

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setup(
77
name = 'scrappeycom', # How you named your package folder (MyLib)
88
packages = ['scrappeycom'], # Chose the same as "name"
9-
version = '0.3.5', # Start with a small number and increase it with every change you make
9+
version = '0.3.6', # Start with a small number and increase it with every change you make
1010
license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository
1111
description = 'An API wrapper for Scrappey.com written in Python (cloudflare bypass & solver)', # Give a short description about your library
1212
author = 'dormic97', # Type in your name

0 commit comments

Comments
 (0)