Use Excel VBA to click on a button in Internet Explorer, when the button has no “name” associated

前端 未结 3 1392
[愿得一人]
[愿得一人] 2020-11-30 06:54

I\'m trying to use excel to automate the value entering in a time sheet. The time sheet is on a web page. Right now I\'m able to load the page, enter my username and passwo

3条回答
  •  情深已故
    2020-11-30 07:37

    CSS selector:

    Use a CSS selector of img[src='images/toolbar/b_edit.gif']

    This says select element(s) with img tag with attribute src having value of 'images/toolbar/b_edit.gif'


    CSS query:


    VBA:

    You can apply the selector with the .querySelector method of document.

    IE.document.querySelector("img[src='images/toolbar/b_edit.gif']").Click
    

提交回复
热议问题