I want the total no of div
s present in html file.
I want the solution in python.
I have tried following code to find div
s using class but now i want size of that div
s.
from bs4 import BeautifulSoup
import random
HTMLFile = open("/home/earth/sample.html", "r")
file = HTMLFile.read()
print(file)
S = BeautifulSoup(file, 'lxml')
Des = S.body
Attr_Tag = [e.name for e in Des.descendants if e.name is not None]
print(Attr_Tag)
mydivs = S.findAll('div',class_="col")
#mydivs=S.select('.col')
print(mydivs)