0

I would like to make a mouse left click on a button in a website using chrome extension. The target website is https://www.urlgot.com/. It is a seemly simple webpage with only one button. I had found a solution to get my interesting DOM content and how to paste text into the textbox.Then how to make a click to the button? As a neophyte in chrome extension scripting, I really need some advice.

The DOM of interesting is as below,

<button type="button" class="button button-action button-circle button-raised" id="parseButton" onclick="parse()"><i class="fa fa-check"></i></button>

I am confused with how to make the click. Thank you.

Wei Zhang
  • 325
  • 2
  • 16

2 Answers2

1

The following code should do the job:

document.getElementById("parseButton").click();
The KNVB
  • 3,588
  • 3
  • 29
  • 54
0

You can use jQuery to click

$('#parseButton').click()

or Javascript

document.getElementById('parseButton').click()