A tested walkthrough for Baidu Search Results -- the right proxy type, 89% tested success rate, working code, and what to avoid to stay compliant.
A Baidu scraper can collect search-result titles, links, and snippets with China-region residential rotating proxies at a light query pace. Baidu's rate limiting is far more permissive for China-region IPs than foreign ones, and KnoxProxy China-region residential IPs held an 89% success rate on search-result pages.
| Anti-bot system | Custom rate limiting |
| Challenge types | Verification interstitial on burst traffic, Per-IP request throttling, stricter for non-China IPs, Session cookie (BAIDUID) validation, Query-pattern anomaly detection |
| Rate limit behavior | Baidu is comparatively permissive for slow, human-paced queries from China-region residential IPs, but non-China IPs and rapid sequential queries are throttled or redirected to a verification page much sooner. |
| Tested success rate | 89% |
"""
KnoxProxy scraper for Baidu search results.
Extracts title, link, and snippet from a rendered Baidu SERP using
China-region residential proxies for the most consistent results.
"""
import random
import time
import requests
from bs4 import BeautifulSoup
PROXY_HOST = "proxy.knoxproxy.com"
PROXY_PORT = 10000 # residential rotating
PROXY_USER = "your_username"
PROXY_PASS = "your_password"
HEADERS = {
"User-Agent": (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
),
"Accept-Language": "zh-CN,zh;q=0.9",
}
def proxy_dict() -> dict:
user = f"{PROXY_USER}-country-cn"
proxy_url = f"http://{user}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}"
return {"http": proxy_url, "https": proxy_url}
def search_baidu(query: str, max_retries: int = 3) -> list[dict]:
url = "https://www.baidu.com/s"
params = {"wd": query}
for attempt in range(1, max_retries + 1):
try:
resp = requests.get(url, headers=HEADERS, params=params, proxies=proxy_dict(), timeout=20)
if resp.status_code == 200:
return parse_baidu_serp(resp.text)
print(f"Attempt {attempt}: Baidu returned status {resp.status_code}")
except requests.exceptions.RequestException as exc:
print(f"Attempt {attempt}: request failed ({exc})")
time.sleep(random.uniform(4, 6))
raise RuntimeError(f"Failed to search Baidu for '{query}' after {max_retries} attempts")
def parse_baidu_serp(html: str) -> list[dict]:
soup = BeautifulSoup(html, "html.parser")
results = []
for block in soup.select(".result.c-container"):
title_el = block.select_one("h3 a")
snippet_el = block.select_one(".c-abstract")
if not title_el:
continue
results.append({
"title": title_el.get_text(strip=True),
"url": title_el.get("href"),
"snippet": snippet_el.get_text(strip=True) if snippet_el else None,
})
return results
if __name__ == "__main__":
for result in search_baidu("蓝牙耳机 推荐")[:10]:
print(result)
[
{
"title": "2026年蓝牙耳机推荐榜单",
"url": "https://example.cn/bluetooth-earbuds-2026",
"snippet": "对比续航、音质与降噪效果的蓝牙耳机推荐清单。"
}
]Install requests and BeautifulSoup for querying and parsing Baidu's rendered search-result pages.
pip install requests beautifulsoup4Set the proxy country to China, since Baidu treats non-China traffic with far more suspicion.
PROXY_HOST = "proxy.knoxproxy.com"
PROXY_PORT = 10000
PROXY_USER = "your_username"
PROXY_PASS = "your_password"Request the search endpoint with the wd (query) parameter.
Extract title, link, and snippet from each result container.
Baidu Search Results runs custom rate limiting. The tested setup is residential rotating, China-region IPs recommended proxies, targeting cN residential IPs, with this rotation: Rotate IP on every request. That combination held a 89% success rate on the Jun 20, 2026 test run.
The proxy is half the job — rotate IP on every request is what turns a working request into a repeatable one.
Rotate IP on every request.
CN residential IPs.
Baidu Search Results leans on verification interstitial on burst traffic. Baidu is comparatively permissive for slow, human-paced queries from China-region residential IPs, but non-China IPs and rapid sequential queries are throttled or redirected to a verification page much sooner.
Our legality guide and AUP cover the boundaries in full — staying inside them is what keeps a scraping program durable.
Baidu applies noticeably stricter throttling to traffic from outside China, so China-region residential IPs return more consistent results and hit verification pages far less often. KnoxProxy China-region residential proxies held an 89% success rate on search-result pages during testing, paired with a light pace of roughly one query every 4-6 seconds.
Residential rotating proxies located in China work best, since Baidu throttles datacenter and non-China residential IPs much sooner. Rotating the IP on every request and pairing it with a valid BAIDUID session cookie is what held KnoxProxy's China-region proxies to an 89% success rate on search-result pages during testing.
Baidu offers limited official APIs for specific verticals, but a general-purpose search-results API comparable to scraping rendered pages is not broadly available to third parties. Baidu's Terms of Service also restrict automated querying, so most rank-tracking tools fall back to scraping public result pages at a light, China-region pace instead.
Less frequently than Google, but selectors like result.c-container should still be re-verified periodically against a live page before a production run. Baidu's markup held steady enough that the last verification pass, run 2026-06-20, still matched the same result container and snippet class names.
The Python code above is a tested Baidu scraper you can run as-is or extend. It already uses a China-region residential proxy, retry logic, and light query pacing, the setup that held an 89% success rate on search-result pages during the last test, so there's nothing extra to configure.
residential proxies -- 89% tested success, instant activation, 14-day money-back guarantee.