i cannot find find the article tag…its directly showing the div class
Regarding image scrapping
In the video 'article tag ’ is available on the wesite.
now as the website is updated ,its no longer showing ‘article tag’.
its only showing <div class and the children.
now my doubt is …may be its a silly one…
when i’m creating soup object i.e. article_element=soup.findAll(‘WHAT SHOULD I WRITE HERE’ )??
i tried div ,but its not showing anything.
hope you’ll get …what i am trying to say…
its the screenshot from the video.
Hey @Lockhart, now i understand your question, actually the html file of the website keeps on changing. This is the reason mentor’s code is no longer working.
Anyways now there are two way out:
-
The easiest hack is to us elements = soup.findAll(‘img’), and find all img tags directly and see manually by printing all elements which belong to quotes or which belong to background image or any other image.
-
The more logical way is to use,
div = soup.findAll('div',attrs = {'class' :'col-6 col-lg-3 text-center margin-30px-bottom sm-margin-30px-top'})
because i noticed that all 32 quotes have this class attribute the same value. so i used that to get those 32 elements only.
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.
yes…it worked …thanks again