Giter Site home page Giter Site logo

chromerequests's Introduction

chromeRequests

A python package that mimics chromes TLS using golang

Installation

Instll chromeRequests using pip

  pip install chromeRequests

API Reference

import chromeRequests

chromeRequests.load_library("./library.so")  # this is necessary, download from go folder.

# get request

response = chromeRequests.get(
    "example.com",
    headers={
        "foo": "bar",
    },
    proxy="http://user:password@host:port"  # never tested with passwordless.
)

# post request

response = chromeRequests.post(
    "example.com",
    headers={
        "foo": "bar",
    },
    json={"foo": "bar"},
    data={"foo": "bar"}
)
response.json()
cookies = response.cookies
headers = response.headers
status = response.status_code
text = response.text

# put request
response = chromeRequests.put(
    "example.com",
    headers={
        "foo": "bar",
    },
    json={"foo": "bar"},
    data={"foo": "bar"}
)
# session

session = chromeRequests.session()

session.set_proxy("http://user:password@host:port")

session.headers.update({
    "foo": "bar"
})

session.headers.get_dict()

session.cookies.set(name, value)

session.cookies.get_dict()

Acknowledgements

Authors

To do

Contributing

Contributions are always welcome!

Please adhere to this project's code of conduct.

chromerequests's People

Contributors

arifali123 avatar justhyped avatar miromiro11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chromerequests's Issues

Not working

Traceback (most recent call last):
File "examples.py", line 4, in
chromeRequests.loadLibrary("./GoLangSource/library.so")
File "/chromeRequests/chromeRequests/chromeRequests.py", line 17, in loadLibrary
library = ctypes.cdll.LoadLibrary(pathToLibrary)
File "/usr/lib/python3.8/ctypes/init.py", line 451, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.8/ctypes/init.py", line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: ./GoLangSource/library.so: invalid ELF header

Issues sending formData

Currently trying to send formData to algolia search endpoint and I get a JSON Decode error.
I have tried converting the data to JSON and using just a string but it will not send it. I am able to send requests normally however so I know the library works.

Sending JSON with Post Requests is not working

json = {"items": [
        {
            "quantity": 1,
            "productCode": "222",
            "customAttributes": {}
        }
    ]}

If i try to set this as my payload for the requests i get a "Exception: json: cannot unmarshal array into Go struct field RequestParameters.parameters.FORM of type map[string]string"

is there a way to put numbers and arrays in json payloads?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.