Question: I'm looking for a way to auto connect to people found via the LinkedIn advanced search function. There's plenty of information on doing this from the 'people you may know' page but I can only find the code below that is meant to work on the advanced search page, but doesn't. Any ideas?

```
setInterval(function () {var x = $(‘.primary-action-button’);for (var i = 0; i < x.length; i++){if(x[i].innerHTML == “Connect”) {x[i].click()}}var y = $(‘a.page-link’);y[y.length — 1].click();}, 1000)

```

Answer: 
```
var i;
var res;
var str1 = "ember";
for(i=0;i < 10000;i++)
{
try {
    res = str1.concat(i);
    if(document.getElementById(res).innerText == "Connect"){
        document.getElementById(res).click();}
    console.log(document.getElementById(res).innerText == "Connect");
    }
catch(err) {
}
}

```
looks like this is not working anymore...

Seems that LinkedIn not use jQuery anymore.

```
VM4213:158 Uncaught ReferenceError: $ is not defined
at Object.setScroll (<anonymous>:158:9)
at <anonymous>:164:22

```