Python Proxy Requests and User Agent

user9283245

I was playing around with a proxy requests module that I found here/pip install proxy-requests. I have successfully been making GET/POST requests to a temporary ptsv2.com bucket as shown in the directions and it seems to be working... My IP listed is actually a proxy server's IP. However my User Agent (in the header) still says Python Requests with a version number. Is it possible to use this module's proxy IP capabilities but also change the User Agent to something other than Python Requests? I want to hide my IP but also the user-agent as well.

zypox

You can set User-Agent in headers like so:

headers = {
    'User-Agent': 'Some custom user agent',
}

r = ProxyRequests("url here")
r.set_headers(headers)
r.post_with_headers({"key1": "value1", "key2": "value2"})

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Python requests - 403 forbidden - despite setting `User-Agent` headers

python-requests - user-agent is being overriden

Sending "User-agent" using Requests library in Python

How to check if my python proxy rotator and user agent spoofing works?

How to redirect requests / proxy based on User-Agent (mobile and desktop) using Grunt or Node server?

How can I get my user agent header in a simple way using requests in python 2.7?

Response [403] Error with Python Requests after adding user-agent and additional headers, Cloudfare blocking access

Set up a proxy with python requests

Catch proxy errors on requests python

Testing for user agent spoofing in python

Setting HTTP User-Agent header with requests-oauthlib

How to specify a default user agent for okhttp 2.x requests

Nginx proxy when $http_user_agent matches mobile

Proxy+Selenium+PhantomJS can't change User-Agent

Does Python requests really connect to http proxy?

check Python requests with charles proxy for HTTPS

Python Requests verify proxy is being utilized

Python Requests doesnt work for https proxy

Python requests with proxy failing for WinError 10060

Python requests using public ip instead of proxy

How to change user agent for Firefox webdriver in Python?

Change user agent used with robotparser in Python

Python selenium with chrome webdriver - change user agent

How to change the User Agent using Selenium and Python

GitHub's API now rejects HTTP requests without a User-Agent - can anyone tell me why?

How do I change my user-agent using Requests Library

What happens if I don't specify the user agent in requests.get()?

How to insert two parameters into watir :: browser ( proxy and user-agent after Browser.new() )

Passing user input into python requests body

TOP Ranking

HotTag

Archive