邮编
按邮政编码定位住宅代理。学习如何将 postalcode 参数与国家代码结合以实现精确的美国位置定位。
代码示例
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME-cc-US-postalcode-90210:PASSWORD" https://ip.oxylabs.io/location<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$country = 'US';
$postalcode = '90210';
$proxy = 'pr.oxylabs.io:7777';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username-cc-$country-postalcode-$postalcode:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
echo $output;
?>import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'US'
postalcode = '90210'
entry = ('http://customer-%s-cc-%s-postalcode-%s:%s@pr.oxylabs.io:7777' %
(username, country, postalcode, password))
query = urllib.request.ProxyHandler({
'http': entry,
'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())最后更新于
这有帮助吗?

