Почему переменная возвращает None? - Python
Формулировка задачи:
Приветствую
Подскажите, почему в данном коде div выводит None, а не верстку
Решение задачи: «Почему переменная возвращает None?»
textual
Листинг программы
import urllib.request
from bs4 import BeautifulSoup
def get_html(url):
response = urllib.request.urlopen(url)
return response.read()
def parse(html):
soup = BeautifulSoup(html, "html.parser")
div = soup.find("div", {"class": "view-articles-front"})
print(div)
parse(get_html('http://www.festivalnauki.ru/articles'))