我试图在此链接https://www.cellmapper.net/arfcn?net=LTE&ARFCN=78&MCC=0中获取表值。每次我需要更改网络类型(LTE或3G或2G)时,我都会更改ARFCN值,并且我想从表结果中获取“Band Number”。我无法通过此代码读取结果表的所有数据。
我的代码:
from lxml.html import parse
from urllib.request import urlopen
import requests
import pandas as pd
from bs4 import BeautifulSoup
def htmltodf(url):
page = requests.get(url)
soup = BeautifulSoup(page.text,features="lxml")
tables = soup.findAll('table')
test = pd.io.html.read_html(str(tables))
print(test)
htmltodf("https://www.cellmapper.net/arfcn?net=LTE&ARFCN=78&MCC=0")
我得到的结果是:都是NAN
[ Result Result.1
0 Network Type NaN
1 E/U/ARFCN NaN
2 Band Name NaN
3 Uplink Frequency (phone to base station) NaN
4 Downlink Frequency (base station to phone) NaN
5 **Band Number NaN**
6 Possible Bandwidths NaN
7 Sector Color NaN]
2条答案
按热度按时间eulz3vhy1#
尝试此版本:
输出:
vh0rcniy2#
考虑看看这个。
https://www.cellmapper.net/TOS
Cellmapper是一个社区驱动的项目,请不要滥用它。