0
import requests
from bs4 import BeautifulSoup

num = '+79031234567'
responce = requests.post(f'https://phonenum.info/phone/7{num}')
soup = BeautifulSoup(responce.content, 'html.parser')
operator = soup.find_all("div", class_="paramValue", id="mnp_ported_operator")

print(f'ОПЕРАТОР: {operator}')

1 ответ 1

1

У вас ошибка в url.
Нужно передать номер без +, а вы передаете номер с + да еще и с цифрой перед ним.
В вашем случае url выглядит так: https://phonenum.info/phone/7+79031234567, на надо так: https://phonenum.info/phone/79031234567.

import requests
from bs4 import BeautifulSoup

num = '79031234567'
responce = requests.post(f'https://phonenum.info/phone/{num}')
soup = BeautifulSoup(responce.content, 'html.parser')
operator = soup.find_all("div", class_="paramValue", id="mnp_ported_operator")

print(f'ОПЕРАТОР: {operator}')

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.