#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import urllib2 import json Info_URL = 'http://www.xxsy.net//ajax/pAjax.aspx?method=binfo&bookid={0}' book_url = sys.argv[1] book_id = book_url.split('/')[-1].replace('.html', '') data = urllib2.urlopen(Info_URL.format(book_id)).read() data = json.loads(data) print 'Book:', data['BookName'], '/', data['AuthorName'] print 'Updated at:', data['Lastupdatetime'] print 'Free:', data['Lastzjname'] print 'VIP:', data['Lastvipzjname']