ezoic

Thursday, May 19, 2016

One amazon web scraping script


using the following script to do the web scarper on Amazon.com:

import requests
import re
url='http://www.amazon.com/s?keywords=new+girl+season+5+amazon+video+'
htmltext=requests.get(url).content
pattern=re.compile(r"http://www.amazon.com/.*/dp/(.*?)\"")
re.findall(pattern,htmltext)

And it works, giving the following ASIN numbers:

['B019DA0TTY',
 'B01EG3ZQG4',
 'B003NS4Q6U',
 'B00J1ZOMQ8',
 'B014DT715A',
 'B00F2CFT02',
 'B017WUJVE6',
 'B005GC8D6U',
 'B002PHLFEG',
 'B00NGYMN3O',
 'B00AWMINLY',
 'B003FOFJAY',
 'B0095NWC36',
 'B005JR3Y5W',
 'B017UGXPG2',
 'B005D643PO',
 'B005D67NTC#customerReviews']
 
First one is what we want.  

No comments:

Post a Comment

looking for a man

 I am a mid aged woman. I live in southern california.  I was born in 1980. I do not have any kid. no compliacted dating.  I am looking for ...