Skip to content

Instantly share code, notes, and snippets.

@masahitojp
Created April 27, 2011 10:01
Show Gist options
  • Save masahitojp/944004 to your computer and use it in GitHub Desktop.
Save masahitojp/944004 to your computer and use it in GitHub Desktop.
[buildout]
parts = pq
[pq]
recipe = z3c.recipe.scripts
eggs = pyquery
interpreter=py
#!/usr/bin/env python
# -*- coding: utf_8 -*-
import urllib
from pyquery import PyQuery as pq
URL = 'http://store.apple.com/jp/'
d = pq(url=URL, opener=lambda url: urllib.urlopen(url).read())
new_items = d('#aos_family img.new-icon').parents('li strong')
for new_item in new_items:
print(new_item.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment