D
D
dJSON002022-01-05 06:34:08
Python
dJSON00, 2022-01-05 06:34:08

Why does BeautifulSoup return []?

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}')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cockie, 2022-01-05
@Cockie

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[0].text}')

I understand the conclusion of the operator from the site is necessary?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question