title: how to extract amazon product links using python
body: <p>I'm a Beginner in Python, I just want to scrap product links from amazon page.
  for example, I want to scrap this page
  <a href="http://www.amazon.com/s/ref=sr_in_-2_p_4_18?me=A3MZ96G5C78IVQ&amp;fst=as%3Aoff&amp;rh=p_4%3AFunKo&amp;ie=UTF8&amp;qid=1477811368" rel="nofollow">http://www.amazon.com/s/ref=sr_in_-2_p_4_18?me=A3MZ96G5C78IVQ&amp;fst=as%3Aoff&amp;rh=p_4%3AFunKo&amp;ie=UTF8&amp;qid=1477811368</a> and I use this code in python</p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  url = "http://www.amazon.com/s/ref=sr_in_-2_p_4_18?me=A3MZ96G5C78IVQ&amp;fst=as%3Aoff&amp;rh=p_4%3AFunKo&amp;ie=UTF8&amp;qid=1477811368"
  r = requests.get(url)
  soup = BeautifulSoup(r.content, "lxml")
  
  file = open("parseddata.txt", "wb")
  
  links = soup.find_all('a', {'class': 'a-link-normal s-access-detail-page a-text-normal'})
  
  for link in links:
  print(link.get('href'))
  file.write(href + '\n')
  file.close()
  </code></pre>
  
  <p>I Just want the products title link as the output. Can anyone tell me where I am doing wrong.</p>