Loading...
Loading...
Look up a Korean postcode and official English address from a known address with the official ePost integrated search page.
npx skill4agent add ptrace815/k-skill zipcode-searchcurlpython3https://www.epost.kr/search.RetrieveIntegrationNewZipCdList.commkeywordEnglish/집배코드viewDetail(...)urllibcurl --http1.1 --tls-max 1.2python3 - <<'PY'
import html
import re
import subprocess
query = "서울특별시 강남구 테헤란로 123"
cmd = [
"curl",
"--http1.1",
"--tls-max",
"1.2",
"--silent",
"--show-error",
"--location",
"--retry",
"3",
"--retry-all-errors",
"--retry-delay",
"1",
"--max-time",
"20",
"--get",
"--data-urlencode",
f"keyword={query}",
"https://www.epost.kr/search.RetrieveIntegrationNewZipCdList.comm",
]
page = subprocess.run(
cmd,
check=True,
capture_output=True,
text=True,
encoding="utf-8",
).stdout
matches = re.findall(
r"viewDetail\('([^']*)','([^']*)','([^']*)','([^']*)',\s*'[^']*'\)",
page,
)
if not matches:
raise SystemExit("검색 결과가 없습니다.")
for zip_code, road_address, english_address, jibun_address in matches[:5]:
print(zip_code)
print(html.unescape(road_address))
print(html.unescape(english_address))
print(html.unescape(jibun_address))
print("---")
PYviewDetail(zip, roadAddress, englishAddress, jibunAddress, rowIndex)123, Teheran-ro, Gangnam-gu, Seoul, 06133, Rep. of KOREApython3 scripts/zipcode_search.py "서울특별시 강남구 테헤란로 123"
./scripts/zipcode_search.py "서울특별시 강남구 테헤란로 123"{
"query": "서울특별시 강남구 테헤란로 123",
"results": [
{
"zip_code": "06133",
"road_address": "서울특별시 강남구 테헤란로 123 (역삼동, 여삼빌딩)",
"english_address": "123, Teheran-ro, Gangnam-gu, Seoul, 06133, Rep. of KOREA",
"jibun_address": "서울특별시 강남구 역삼동 648-23 (여삼빌딩)"
}
]
}테헤란로 123서울 강남구 테헤란로 123역삼동 648-23mktemp| headcurl: (23)viewDetail(...)curl