In [1]:
import os
In [2]:
from bs4 import BeautifulSoup
In [3]:
import mnc
In [4]:
mnc.data[0]['operator']
Out[4]:
In [5]:
[(k, mnc.data[0][k]) for k in mnc.data[0] if k.endswith('.score')]
Out[5]:
In [6]:
mnc_data = mnc.MncData()
In [7]:
mnc_data.plans[:4]
Out[7]:
In [8]:
mnc_data.populate()
In [9]:
mnc_map = mnc.Map()
In [10]:
for x, y in mnc_map.active_mnc2payg.items():
if mnc_data.call[x] != str(mnc.data[y]['min_other']) + 'p':
print(mnc_data.call[x], str(mnc.data[y]['min_other']) + 'p', x)
In [11]:
for x, y in mnc_map.active_mnc2payg.items():
if mnc_data.text[x] != str(mnc.data[y]['sms_other']) + 'p':
print(mnc_data.text[x], str(mnc.data[y]['sms_other']) + 'p', x)
In [12]:
len(mnc_map.active_mnc2payg)
Out[12]:
In [13]:
len(mnc_map.defunct)
Out[13]:
In [14]:
for x, y in mnc_map.active_mnc2payg.items():
if mnc_data.text[x] != str(mnc.data[y]['sms_other']) + 'p':
print(mnc_data.text[x], str(mnc.data[y]['sms_other']) + 'p', x)
In [15]:
len(mnc_data.all)
Out[15]:
In [16]:
with open(os.path.expanduser('~/Downloads/PAYG/MNC/comparison table 002.html')) as f:
soup = BeautifulSoup(f, 'html.parser')
In [17]:
calls = soup.find_all('td', 'calls')
In [18]:
len(calls)
Out[18]:
In [19]:
calls[0].text
Out[19]:
In [20]:
ggcalls = calls[0]
In [21]:
ggcalls.parent.find('td', 'network').text
Out[21]:
In [22]:
str(ggcalls.parent.find('td', 'network')).split(':')[1]
Out[22]:
In [25]:
[str(c.parent.find('td', 'network')).split(':')[1] for c in calls if 'TalkMobile' not in str(c)]
In [26]:
%debug