Question: I'm trying to automate a click when visting a website. This is the HTML I'm looking at.

```
<div class="box_wrapper">
     <a id="itemcode_11094414" class="box">7.5</a>
     <a id="itemcode_11094415" class="box">8</a>
     <a id="itemcode_11094416" class="box">8.5</a>
</div>

```

when I select the size, say for instance size 8, the class= tag turns to "box active" like so,

```
<div class="box_wrapper">
     <a id="itemcode_11094414" class="box">7.5</a>
     <a id="itemcode_11094415" class="box active">8</a>
     <a id="itemcode_11094416" class="box">8.5</a>
</div>

```

How can I go loop through the class and select a desired size? Also, I was just tinkering around and noticed that I had a hard time simulating a click on the add to cart and other buttons. For the add to cart the HTML looks like this, 

```
<div class="add_to_cart">
    <div class="add_to_cart_left">
        <img id="add_to_bag_btn" alt="Add To Bag" src="/images/add_to_bag.gif"></img>  
        <img id="add_to_bag_btn_processing" alt="" src="/images/add_to_bag_processing.gif"></img>
    </div>
</div>

```

Is this the correct chunk of HTML I should be looking at for a simulation of a click?

Answer: 
The problem is the 9 patch itself: it's **malformed**.  

The black line on the **left side** is simply WRONG (it "touches" the lens).  

It should be a single pixel near the lower part, so that its prolongation doesn't touch the lens.

This is it

![enter image description here](https://i.stack.imgur.com/ZRPC5.png)

Note that the lens will be **up-right aligned**.  

If you want it **centered**, you have to add another black pixel near the upper left border (but you have to replace some pixels near the upper lens frame, too).

Also not thet you don't need the horizontal part being that wide, you can make it **much narrower**, to save on the final patch size.
After using 9patch to create a photo, you can a image file which it's file extension is XX.9.png.
For example, search.9.png in drawable folder and you should use "android:background=@drawable/search" in xml.