0
0 комментариев

python 3.8.1

windows 10

Код:

import requests
from bs4 import BeautifulSoup

url = ‘https://www.google.com/search?q=%D1%81%D0%BA%D0%BE%D0%BB%D1%8C%D0%BA%D0%BE+%D0%BE%D1%81%D1%82%D0%B0%D0%BB%D0%BE%D1%81%D1%8C+%D0%B4%D0%BE+%D0%BB%D0%B5%D1%82%D0%B0&oq=%D1%81%D0%BA%D0%BE%D0%BB%D1%8C&aqs=chrome.0.69i59l3j69i57j0j69i60l2j69i61.1168j1j4&sourceid=chrome&ie=UTF-8’

day = requests.get(url)
main_text = day.text
soup = BeautifulSoup(main_text)

a = soup.find(‘div’, {‘class’ : ‘HwtpBd gsrt PZPZlf’})

print(a)

Ошибка:

The code that caused this warning is on line 8 of the file C:\Users\taxi\Desktop\tex.py. To get rid of this warning, pass the additional argument ‘features=»html.parser»‘ to the BeautifulSoup constructor.


Добавить комментарий