Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Paul McGuire
On Sep 15, 11:32 pm, Stefan Behnel wrote: > Also untested: > >         from lxml import html > >         doc = html.parse(page_url) >         doc.make_links_absolute(page_url) > >         urls = [ img.src for img in doc.xpath('//img') ] > > Then use e.g. urllib2 to save the images. Looks similar

Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Stefan Behnel
Chris Rebert wrote: > page_url = "http://the.url.here"; > > with urllib.urlopen(page_url) as f: > soup = BeautifulSoup(f.read()) > for img_tag in soup.findAll("img"): > relative_url = img_tag.src > img_url = make_absolute(relative_url, page_url) > save_image_from_url(img_url) > >

Re: Retrieve url's of all jpegs at a web page URL

2009-09-15 Thread Chris Rebert
On Tue, Sep 15, 2009 at 7:28 AM, grimmus wrote: > Hi, > > I would like to achieve something like Facebook has when you post a > link. It shows images located at the URL you entered so you can choose > what one to display as a summary. > > I was thinking i could loop through the html of a page with