There is a webpage which when loaded uses a random placement of forms / controls / google ads.  However, the set is closed--from my tests there are at least three possible variations, with two very common and the third very rare.  
I would like to be able to classify this webpage according to each variation.  I tried analyzing the html source of each variation, but the html of all the variations is exactly the same, according to both Python string equals and the Python difflib.  There doesn't seem to be any information specifying where to put the google ads or the controls.  
For an example, consider a picture with two boxes, a red one (call it box A) and a blue one (call it box B).  The boxes themselves never change position, but what takes their position does.
Now consider two possible variations, one of which is chosen everytime the webpage is loaded / opened.  
Variation 1: Suppose 50% of the time, the google ad is positioned at box A (the red one) and the website control is thus placed at box B (the blue one).  
Variation 2: Suppose also 50% of the time, the google ad is positioned at box B (the blue one) and the website control is thus placed at box A (the red one).  
So if I load the webpage, how can I classify it based on its variation?
If the HTML is definitely the same every time, the variations are probably being done on the client side using javascript.
The answer depends on what you mean by "classify." If you just want to know, on any given load of the page, where the widgets are, you will probably have to use something like Selenium that actually opens the page in a browser and runs javascript, rather than just fetching the HTML source. Then you will need to use Selenium to eval some javascript that detects the widget locations. There is a selenium module for python that is fairly straightforward to use. Consider hooking it up to PhantomJS so you don't have to have a browser window up.
Classify different versions of the same webpage