a = '(255,0,0)'
b = tuple(int(element) for element in a[1:-1].split(','))
print(type(b), b)
import requests
from bs4 import BeautifulSoup
import pandas as pd
url = 'https://mintrans.gov-murman.ru/activities/taxi/reestr_taxi/'
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
data = soup.find_all(class_ = 'file')
a = str(data).split('href="/')
a_1 = str(a[1]).split('">\n<span')
a_2 = ''.join(a_1[0].split('amp;'))
a_3 = 'https://mintrans.gov-murman.ru/' + a_2
df = pd.read_excel(a_3, skiprows=2)
ipaddress provides capabilities to work with IP addresses and networks (both IPv4 and IPv6).
ip = ipaddress.ip_address('127.0.0.1')
ip.is_private # True
ip.is_loopback # True
ip.is_global # False
ip.is_multicast # False
ip.is_reserved # False
ip.is_unspecified # False
ip.reverse_pointer # '1.0.0.127.in-addr.arpa'
net = ipaddress.ip_network('192.168.0.0/28')
net.is_private # True
net.hostmask # IPv4Address('0.0.0.15')
net.num_addresses # 16
page_content = []
page_text = '''
12" Non-Stick Skillet
with Helper Handle
Model: FCT22-30HNS
UPC: 086279034182
Case Pack: 4
5½ Qt. Sauté Pan with Cover
Model: FCT33-28H
UPC: 086279034038
Case Pack: 4
8" Skillet
Model: FCT22-20
UPC: 086279034007
'''
for line in page_text.splitlines():
if 'Model:' in line:
page_content.append(line)
print(page_content)
['Model: FCT22-30HNS ', 'Model: FCT33-28H ', 'Model: FCT22-20 ']