Чтобы узнать цену продления домена для Hostinger, вы можете использовать различные методы в зависимости от доступных ресурсов и языка программирования, который вы предпочитаете. Вот несколько методов с примерами кода:
-
Использование API Hostinger (Python):
import requests def get_domain_renewal_price(domain): url = f"https://api.hostinger.com/v1/domains/{domain}/pricing" response = requests.get(url) data = response.json() renewal_price = data["renewal_price"] return renewal_price # Example usage domain = "example.com" renewal_price = get_domain_renewal_price(domain) print(f"The renewal price for {domain} is {renewal_price}") -
Парсинг веб-сайта (Python с BeautifulSoup):
import requests from bs4 import BeautifulSoup def get_domain_renewal_price(domain): url = f"https://www.hostinger.com/domain-checker?domain={domain}" response = requests.get(url) soup = BeautifulSoup(response.content, 'html.parser') renewal_price = soup.find(class_="renewal-price").get_text() return renewal_price # Example usage domain = "example.com" renewal_price = get_domain_renewal_price(domain) print(f"The renewal price for {domain} is {renewal_price}") -
Использование поиска WHOIS (Python с библиотекой python-whois):
import whois def get_domain_renewal_price(domain): w = whois.whois(domain) renewal_price = w.price return renewal_price # Example usage domain = "example.com" renewal_price = get_domain_renewal_price(domain) print(f"The renewal price for {domain} is {renewal_price}")