I am trying to scrape all images URLs from any website.
from bs4 import BeautifulSoup
import urllib.request as urllib2
import re
html_page = urllib2.urlopen("http://imgur.com")
soup = BeautifulSoup(html_page, features="html5lib")
images = []
for img in soup.findAll('img', limit=None, recursive=True):
images.append(img.get('src'))
print(images)
It is tutorial code although it seems not to work. I have tried changing parser, setting limits to None, but it always returns only two results while there is plenty of img elems on this wesbite
['https://www.facebook.com/tr?id=742377892535530&ev=PageView&noscript=1', 'https://sb.scorecardresearch.com/p?c1=2&c2=22489583&cv=3.6.0&cj=1']
Could you please tell me how to get all of them?