What is Python-urllib?

Python-urllib is software in the HTTP clients and libraries category.

Bot name
Python-urllib
Developer
Unknown
Type
Software
Respects robots.txt
Not confirmed
robots.txt user agent
Python-urllib
Signs requests (Web Bot Auth)
No

About Python-urllib

Python-urllib is the default user agent of urllib, the HTTP client in Python's standard library. Python scripts that do not set their own user agent send it.

HTTP clients are programming libraries and command line tools. Developers use them for scripts, integrations and scrapers. Real browsers never send these user agents, so treat them as automated traffic and block them on pages meant for people.

Python-urllib user agent

Anyone can copy a user agent string. Transfon Security also checks where each request comes from, so a request that claims to be a known crawler but comes from the wrong network is treated as a fake, not as the real crawler.

How to block Python-urllib in robots.txt

We have not confirmed whether Python-urllib follows robots.txt. Add a rule, then check your logs to see that it stopped. robots.txt is a plain text file at the root of your domain, such as https://example.com/robots.txt.

Block Python-urllib from the whole site

User-agent: Python-urllib
Disallow: /

Block Python-urllib from some folders

User-agent: Python-urllib
Disallow: /private/
Disallow: /search

Allow Python-urllib only on some folders

User-agent: Python-urllib
Allow: /blog/
Disallow: /

Allow Python-urllib and block other crawlers

User-agent: Python-urllib
Allow: /

User-agent: *
Disallow: /

Things to know

  • Each host needs its own file. Rules on www.example.com do not apply to shop.example.com.
  • A crawler obeys only the most specific group that names it. Once you add a User-agent: Python-urllib group, Python-urllib ignores your User-agent: * rules, so repeat any that should still apply.
  • The user agent name is not case sensitive. We take Python-urllib from Python-urllib's user agent; check the operator's own documentation if it publishes a different robots.txt name.
  • Crawlers cache robots.txt, so changes can take up to a day to apply. Disallow stops crawling but does not remove pages already collected or indexed.

Limits of robots.txt

  1. Python-urllib may not follow the rule. robots.txt is a request that nothing enforces, and we have not confirmed that Python-urllib follows it. Check your logs after adding a rule.
  2. The user agent could be fake. robots.txt matches the name a request claims. Anyone can send Python-urllib's user agent, and a scraper using it is not bound by the operator's robots.txt policy. Only checking the source network tells a real Python-urllib from a fake one.

Treat robots.txt as a statement of your policy, and enforce it where requests arrive.

Who should care about Python-urllib

Publishers

Python-urllib is a common tool for scrapers. Real readers never use it, so block it on article pages and keep it out of ad requests.

Transfon Security for publishers

Media buyers and advertisers

Traffic from Python-urllib on landing pages is automated. It inflates clicks and visits, so filter it from campaign data and raise it with the ad network.

Transfon Security for advertisers

E-commerce

Price scrapers, stock checkers and card testing scripts often run on Python-urllib. Block it on product, cart and checkout pages.

Transfon Security for e-commerce

SaaS and APIs

Python-urllib is normal for API clients but not for your web app. Allow it only on API routes that need a key, and rate limit it there.

Transfon Security for SaaS and APIs

Block Python-urllib with Transfon Security

robots.txt is a request, not an enforcement. Transfon Security shows Python-urllib by name in the Top Bots report, so you can see how often it visits and which pages it reads. Block or allow it with a User Agent rule, or slow it down with a rate limit decision rule.

Transfon Security

Control Python-urllib on your site

  • See every Python-urllib visit and the pages it reads
  • Spot bots that fake trusted crawler names
  • Block, allow or rate limit Python-urllib with one rule
  • Works with or without robots.txt support

Frequently asked questions

What is Python-urllib?

Python-urllib is software in the HTTP clients and libraries category. Python-urllib is the default user agent of urllib, the HTTP client in Python's standard library. Python scripts that do not set their own user agent send it.

Does Python-urllib respect robots.txt?

We have not confirmed whether Python-urllib follows robots.txt. Add a robots.txt rule, then check your logs to see that it stopped, and block it by user agent if it did not.

How do I block Python-urllib?

Add "User-agent: Python-urllib" followed by "Disallow: /" to the robots.txt file at the root of your site. To enforce it, block requests whose user agent contains "Python-urllib/" at your WAF. In Transfon Security that is one User Agent block rule.

Is robots.txt enough to block Python-urllib?

No. robots.txt is voluntary, so Python-urllib may not follow it, and anyone can send Python-urllib's user agent, so a fake Python-urllib ignores your rule. Enforce the rule where requests arrive, at your WAF, and check the source network.

Should I block Python-urllib?

HTTP clients are programming libraries and command line tools. Developers use them for scripts, integrations and scrapers. Real browsers never send these user agents, so treat them as automated traffic and block them on pages meant for people.

Related bots

All HTTP clients and libraries · Full bot directory

See Which Bots Visit Your Site

Transfon Security identifies every bot in this directory in your traffic reports, flags fake search crawlers, and lets you allow, block or rate limit each bot.

Stay ahead of the publishing curve

Privacy, security, monetization, and performance insights. A few emails a month, no spam.

By subscribing you agree to our privacy policy.