get picture from dynamic content python
Question: I'm trying to get the href of the picture from an url without using selenium

    
    
    def():
        try:
            page = urllib2.urlopen('')
        except httplib.IncompleteRead, e:
            page = e.partial              
             response = BeautifulSoup(page)
             print response
             var = response.find("div", {"id":"il_m"}).find('p')
    

but i got None as a result.What should I do to ge the href ?


Answer: You can also get the link from an _anchor_ tag with a _download_ attribute:

    
    
    In [2]: from bs4 import BeautifulSoup
    In [3]: import urllib2
    
    In [4]: r = urllib2.urlopen('http://icecat.us/index.php/product/image_gallery?num=9010647&id=9409545&lang=us&imgrefurl=philips.com')    
    In [5]: soup = BeautifulSoup(r,"html.parser")
    
    In [6]: print(soup.select_one("p a[download]")["href"])
    http://images.icecat.biz/img/gallery/9010647-Philips-_FP.jpg
    

You should also take note of the text _Images may be subject to copyright._.
on the page.

