Click Javascript button python, spynner
I want to click button without name using a spynner. The button looks like this:
<li> <a onclick="save(); return false;" href="">
<img src="/pathtoimage" width="31" height="13" alt="Save Changes"img border="0"></a>
</li>
</ul>
Have you any idea? Please write 开发者_开发知识库some code. Any help is much appreciated!
You can call any javascript that is in the page by using(in your case):
br = spynner.Browser()
br.runjs("save();")
You have access to all the javascript that is accessible to the page.
you could (2 years ago...) refer to this "button" as an image with a unique attributes.
in your example i'd use something like:
browser.click('img[alt="Save Changes"]')
精彩评论