When I use .children and .descendants, it will give me same print, why?
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen("http://ift.tt/2pr0Ni4")
bsObj = BeautifulSoup(html, "lxml")
for child in bsObj.find("table", {"id": "giftList"}).children:
print(child)
for child in bsObj.find("table", {"id": "giftList"}).descendants:
print(child)
Aucun commentaire:
Enregistrer un commentaire