Skip to content

Instantly share code, notes, and snippets.

@andre-manoel
Created April 11, 2016 14:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andre-manoel/f0239fb0a2d5deaf15331f4bfe6a827f to your computer and use it in GitHub Desktop.
Save andre-manoel/f0239fb0a2d5deaf15331f4bfe6a827f to your computer and use it in GitHub Desktop.
Error 503
import bs4
import requests
def getAmazonPrice(productUrl):
res = requests.get(productUrl)
res.raise_for_status()
soup = bs4.BeautifulSoup(res.text, 'html.parser')
elems = soup.select('#newOfferAccordionRow .header-price')
return elems[0].text.strip()
price = getAmazonPrice('http://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=&sr=')
print('The price is ' + price)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment