1 trong những cách rất cơ bản đó là mua proxy và crawl dùng proxy đó. Hiện tại mình sử dụng webshare.io. Mua gói $3 được 100 proxies và 250GB bandwidth

Sử dụng vô cùng đơn giản. Webshare.io cho bạn 2 chế độ là manual và auto:
- Manual: tự chọn proxy trong list đó mà dùng
- Auto: dùng qua url và hệ thống sẽ tự đổi định kỳ proxy


Khi dùng python sử dụng như sau:
url = "URL_YOU_NEED_TO_CRAW"
# Proxy settings
proxy_host = 'HOST'
proxy_port = 'POST'
proxy_username = 'USERNAME'
proxy_password = 'PASSWORD'
# Set up proxy authentication
proxy_auth = HTTPProxyAuth(proxy_username, proxy_password)
# Set up proxy dictionary
proxies = {
'http': f'http://{proxy_username}:{proxy_password}@{proxy_host}:{proxy_port}',
'https': f'https://{proxy_username}:{proxy_password}@{proxy_host}:{proxy_port}'
}
response = requests.request(
"GET", url, headers=headers, data=payload, proxies=proxies, auth=proxy_auth)
Article Categories:
dev