import urllib2 from BeautifulSoup import BeautifulSoup while True: title=raw_input ("Title: ") # Type e to exit if (title == "e"): break; author=raw_input ("Author: ") # Replace Spaces with + symbol for URL author = author.replace(" " , "+") title = title.replace(" " , "+") webpage="http://www.abebooks.com/servlet/SearchResults?an=" + author + "&bi=h&bx=off&dj=on&ds=30&fe=on&recentlyadded=all&sortby=17&sts=t&tn=" + title web = urllib2.urlopen(webpage) soup=BeautifulSoup(web) # Search Webpage for Price and retrieve Text price = soup.find('span', attrs={'class' : 'price'}).getText() # Print the Results print ("New: " + price + "\n")
I am pretty sure I can not install Beautiful Soup onto my phone so I was wondering how I would go about fixing this?
Edit: Seems my code lost indenting upon transfer.
Edited by shaggy111, 16 September 2012 - 08:31 PM.