Hello,
I'm trying to automate putting a series of items into my cart. Here's the html 
for the add-to-cart button on the website:
<a class="PDP_button_addToCart2" 
href="http://cart.half.ebay.com/ws/eBayISAPI.dll?HalfAddItemToCart&amp;ap=additem&amp;itemid=343343950913&amp;pr=57017296&amp;fromshop=1";>Add
 to cart</a></td>
Using the cookielib and urllib2 module, I did:

a= text.find("href")+6
b = text.find('"', a)
url = text[a:b]
new_text = opener.open(url).read()

It goes to the page that shows my cart, but there are zero items--the item is 
not added to the cart.
I'm guessing this has something to do with:

class="PDP_button_addToCart2"

I'm not sure how to have Python click the button.
In general, despite scouring the Internet, I haven't been able to figure out 
how to get Python to cause javascripts I find in the html to be run.
Any help would be greatly appreciated.
Thanks,
Ben

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to