Proxies for a student research project covers what to settle before you collect anything: whether you need a proxy at all, what to ask your supervisor, robots.txt, and keeping the cost small. This post is the hands-on part for a first project. You get a script that fetches a list of pages politely through ProxyDesk, and two records of what it did that you can put side by side in a method section.
Everything below was run, not just written. We built ProxyDesk's engine from its source, put a test proxy behind it, and ran the script and the commands through it, including the moment the proxy stopped.
Why a local address helps a first project
ProxyDesk runs on your computer and gives your programs one local address: 127.0.0.1:18080 for HTTP and 127.0.0.1:11080 for SOCKS5. Your proxies sit behind it. For a first project that brings four practical things.
- The proxy login stays out of your code. The script talks to 127.0.0.1. The username and password live in ProxyDesk, so you can share the script with a supervisor or put it in a repository without sharing a password.
- You can change proxies without touching the script. Add, remove or swap them in ProxyDesk; the address in the code stays the same.
- Nothing goes out from your own address by accident. ProxyDesk tries up to three proxies for each connection, and if none works it refuses the connection rather than sending it from your connection. For a method section, "every request went through the proxy or failed" is easier to defend than "most of them did".
- You get a second log. ProxyDesk records every connection itself, separately from anything your script writes.
What you need
- ProxyDesk running with at least one working proxy. The ProxyDesk guide covers download, sign-in or import, and Start.
- Python 3 with requests:
pip install requests. - A list of pages you are allowed to collect, and the pace you agreed. Academic research is on the allowed list of our acceptable use policy, and the same policy says what is not allowed.
Step 1: check the local address
curl -x http://127.0.0.1:18080 https://api.ipify.org
It prints one IP address: the exit your requests will use. If curl answers CONNECT tunnel failed, response 502 instead, ProxyDesk has no working proxy at the moment. Open its Proxies page to see which one is retrying and why.
Step 2: the script
Put the pages in urls.txt, one address per line, and save this as fetch.py beside it:
import csv
import time
from datetime import datetime, timezone
import requests
PROXY = "http://127.0.0.1:18080"
PROXIES = {"http": PROXY, "https": PROXY}
HEADERS = {"User-Agent": "coursework-crawler ([email protected])"}
DELAY = 5
with open("urls.txt") as f:
urls = [line.strip() for line in f if line.strip()]
with open("fetched.csv", "w", newline="") as out:
log = csv.writer(out)
log.writerow(["time", "url", "status", "bytes"])
for url in urls:
try:
r = requests.get(url, headers=HEADERS, proxies=PROXIES, timeout=30)
status, size = r.status_code, len(r.content)
except requests.RequestException as error:
status, size = type(error).__name__, 0
when = datetime.now(timezone.utc).isoformat(timespec="seconds")
log.writerow([when, url, status, size])
print(when, url, status, size)
time.sleep(DELAY)
Run it with python3 fetch.py. Our run against the three reserved example domains printed this, and wrote the same rows to fetched.csv:
2026-11-06T09:16:48+00:00 https://example.com/ 200 577
2026-11-06T09:16:53+00:00 https://example.net/ 200 577
2026-11-06T09:16:58+00:00 https://example.org/ 200 577
A few choices in it are worth knowing:
- It uses the HTTP address, so plain requests is enough. The SOCKS5 address needs
pip install requests[socks]. - It waits five seconds between requests and sends one at a time. Set
DELAYto what the site's robots.txt or your agreement says. - The User-Agent names you and gives an address to write to, so a site owner can contact you.
- A failed request is written down, with the name of the error and zero bytes, not skipped. Your data then shows its own gaps.
- The size is the body after decompression. requests unpacks gzip for you, so
len(r.content)is not what crossed the wire. ProxyDesk's log has that number.
Step 3: what went through, from ProxyDesk's side
Open Activity in ProxyDesk. Each row is one connection: when it happened, where it went, which proxy carried it, the result, and the bytes. Export CSV saves the list with this header:
time,destination,upstream,result,cause,error,bytes_up,bytes_down
The two files do not say the same thing, and the differences are useful:
- ProxyDesk sees connections, not pages. For an
httpsaddress it records the site's name and port, such asexample.com:443. The path and the page stay inside the encrypted tunnel. Yourfetched.csvhas the full address. - Its byte counts are what crossed the connection, in each direction, including the TLS handshake and the headers. They are larger than your body sizes. Count your own bytes explains where the gap comes from.
- It records refusals too, with a cause, so a failed request in your file has a matching row that says why.
- It leaves out its own health checks. ProxyDesk tests its proxies in the background and counts that traffic separately; it never appears in this list.
- It keeps the most recent 500 connections while it runs. Export after each run if you want the whole history.
Put together, the two files say: here is what I asked for, and here is what went out, through which proxy, and when.
Step 4: what a failure looks like
To see the failure case, we stopped the only proxy behind ProxyDesk and ran the script again:
2026-11-06T09:17:10+00:00 https://example.com/ ProxyError 0
2026-11-06T09:17:15+00:00 https://example.net/ ProxyError 0
2026-11-06T09:17:20+00:00 https://example.org/ ProxyError 0
No page was fetched, and none was fetched from our own connection either. ProxyDesk keeps testing the failed proxy on its own, after 5 minutes and then at longer intervals, and once it passes, the next run goes through again. When your proxy stops working has the details of this behaviour, and of what the browser extension does in the same situation.
Keep it polite, and inside the rules
- One steady address is often the better choice. ProxyDesk's default gives each new connection the next proxy in the list. For coursework, switching to Stay on one proxy until it fails in Settings means the site sees one address together with your contact details, which is easier for its owner to deal with than a rotating crowd.
- A 429 or a 503 means slow down. Back off and try later; retries without burning bandwidth shows how. If a site has asked you to stop, stop: more proxies do not change that.
- Collect only what the question needs, and agree how you will store it before you start, as the student post explains.
Quick answers
Can I use the SOCKS5 address instead? Yes. Install requests[socks] and set PROXY to socks5h://127.0.0.1:11080. The h makes the proxy look up site names, so the lookup does not leave from your own connection either.
Do I need a ProxyPanda account? To download ProxyDesk, yes: the builds are on the Desktop app page of your dashboard. The proxies inside it can come from anywhere.
Does ProxyDesk record page contents? No. It records connections: where to, through which proxy, the result and the bytes.
Next step
Before you order anything, estimate what the scrape will cost. If you are unsure whether your project fits our rules, ask in Discord first.