import requests
from bs4 import BeautifulSoup
URL = 'https://example.com'
page = requests.get(URL)
soup = BeautifulSoup(page.content, 'lxml')
tel_link = soup.find_all('a', class_='sc-62xgu6-0 dokyUu sc-mwxddt-0 kCqoeY hui-link')
for link in tel_link:
num = link['href']
print(num)
$ python
Python 3.10.2 (main, Mar 8 2022, 23:56:15) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> from bs4 import BeautifulSoup
>>> URL = 'https://pixabay.com/ru/'
>>> response = requests.get(URL)
>>> soup = BeautifulSoup(response.text, 'lxml')
>>> soup.title
<title>Attention Required! | Cloudflare</title>
>>>
firmware-realtek
.функция find_all работает некорректно
хотя исходные данные верные
from bs4 import BeautifulSoup
import requests
def parser():
URL = 'https://www.avito.ru/voronezh/tovary_dlya_kompyutera/komplektuyuschie/materinskie_platy-ASgBAgICAkTGB~pm7gnOZw?cd=1&q=%D0%BC%D0%B0%D1%82%D0%B5%D1%80%D0%B8%D0%BD%D1%81%D0%BA%D0%B0%D1%8F+%D0%BF%D0%BB%D0%B0%D1%82%D0%B0+%D1%81+%D0%BF%D1%80%D0%BE%D1%86%D0%B5%D1%81%D1%81%D0%BE%D1%80%D0%BE%D0%BC'
HEADERS = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.41'}
site = requests.get(URL, headers=HEADERS)
soup = BeautifulSoup(site.content, "lxml")
print(soup.prettify())
parser()
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 82D96E430A1F1C0F0502747E37B90EDD4E3EFAE4
$ ip='1.1.1.1';echo '{"chat_id":"12122","text":$ip}'
{"chat_id":"12122","text":$ip}
$ ip='1.1.1.1';echo "{\"chat_id\":\"12122\",\"text\":\"$ip\"}"
{"chat_id":"12122","text":"1.1.1.1"}
getent passwd | awk -F: '{print $1}' | sort -n | awk '{print NR" - "$1}'
охватывает ли он все, что дают вышеназванные линтеры?
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> words = 'как дела'
>>> phrase = 'у тебя дела как'
>>> [word for word in words.split(' ') if word in phrase.split(' ')] == words.split(' ')
True
>>> phrase = 'у тебя дела'
>>> [word for word in words.split(' ') if word in phrase.split(' ')] == words.split(' ')
False
>>>