开发者

Click Javascript button python, spynner

开发者 https://www.devze.com 2023-03-23 08:43 出处:网络
I want to click button without name using a spynner. The button looks like this: <li> <a onclick=\"save(); return false;\" href=\"\">

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"]')
0

精彩评论

暂无评论...
验证码 换一张
取 消