Created
April 27, 2011 10:01
-
-
Save masahitojp/944004 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[buildout] | |
parts = pq | |
[pq] | |
recipe = z3c.recipe.scripts | |
eggs = pyquery | |
interpreter=py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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