Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import urllib2
- def get_html(ASIN):
- headers = {
- 'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/420+ (KHTML, like Gecko) Chrome/14.0.835.186 Safari/419.3'
- }
- if ASIN != 'NoURL':
- req = urllib2.Request(
- url = 'http://www.amazon.com/gp/offer-listing/%s?condition=new' % (ASIN),
- headers = headers
- )
- print ' [d] requesting req'
- resp = urllib2.urlopen(req)
- print ' [d] reading resp'
- data = resp.read()
- print ' [d] returning data...'
- return data
- else:
- return None
Advertisement
Add Comment
Please, Sign In to add comment