Skip to content

Commit 093da34

Browse files
committed
post request fix
1 parent e5b4dbd commit 093da34

File tree

7 files changed

+9
-6
lines changed

7 files changed

+9
-6
lines changed

dist/scrappeycom-0.3.2.tar.gz

-5.25 KB
Binary file not shown.

scrappeycom.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: scrappeycom
3-
Version: 0.3.2
3+
Version: 0.3.3
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

scrappeycom.egg-info/requires.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
requests
2+
urllib
3.46 KB
Binary file not shown.

scrappeycom/scrappey.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import requests
2+
import urllib.parse
23

34
class Scrappey:
45
def __init__(self, api_key):
@@ -47,10 +48,10 @@ def post_request(self, url, post_data, session_id=None, cookiejar=None, proxy=No
4748

4849
if not is_form_data:
4950
try:
50-
request_data = requests.utils.quote(post_data)
51+
request_data = urllib.parse.urlencode(post_data)
5152
except ValueError:
5253
raise ValueError('Invalid postData format. It must be in application/x-www-form-urlencoded format.')
5354
else:
5455
request_data = post_data
5556

56-
return self.send_request('request.post', 'POST', {'url': url, 'postData': request_data, 'session': session_id, 'cookiejar': cookiejar, 'proxy': proxy})
57+
return self.send_request('request.post', 'POST', {'url': url, 'postData': request_data, 'session': session_id, 'cookiejar': cookiejar, 'proxy': proxy})

scrappeycom/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ def run_test():
77
session = scrappey.create_session()
88
print(session)
99

10-
get_request_result = scrappey.get_request('https://reqres.in/api/users', session['session'])
10+
get_request_result = scrappey.get_request('https://httpbin.rs/get', session['session'])
1111
print('GET Request Result:', get_request_result)
1212

1313
post_data = {'username': 'user123', 'password': 'pass456'}
14-
post_request_result = scrappey.post_request('https://reqres.in/api/users', post_data, session['session'])
14+
post_request_result = scrappey.post_request('https://httpbin.rs/post', post_data, session['session'])
1515
print('POST Request Result:', post_request_result)
1616

1717
scrappey.destroy_session(session['session'])

setup.py

Lines changed: 2 additions & 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.2', # Start with a small number and increase it with every change you make
9+
version = '0.3.3', # 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
@@ -18,6 +18,7 @@
1818
long_description_content_type='text/markdown',
1919
install_requires=[ # I get to this in a second
2020
'requests',
21+
'urllib'
2122
],
2223
classifiers=[
2324
'Development Status :: 5 - Production/Stable', # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package

0 commit comments

Comments
 (0)