How to Find a iPad 2 using Python

I did not buy the version 1 iPad because an iPad without a front facing camera just does not seem right. At iPad 2 launch day, I was going to go stand in line (as I did for my iPhone 3GS) for one, as my office is about a mile away from the Boston Apple Store. However real work got in the way.

I did not anticipate the demand for this thing. I guess a lot of people were like me, skipping the iPad 1 and waited for the iPad 2. I did place an order order days after, which is of course too late.

Python to the rescue! Someone posted the links to check for stock on the Target mobile site. I threw together a quick python script, using BeautifulSoup (Don't you love BeautifulSoup ?) to scrape the site. Saturday night, I found a 32G black iPad 2 available in a Target close by ! I drove over almost first thing Sunday morning, only to find that the two that they had in stock was already purchased by someone who got there, waited for the store to open, at 8am.

Lesson here? Programming is easy. Actually getting up in the morning and driving over to wait in line is, well, a bit overkill. I think I will just wait for the online shipment.

Meanwhile, you can try out the python program here. Rename to .py for running.