I\'d like to search the body for an href that contains /test/
. I then want to return the entire href value e.g. /test/123/
.
Below is what I
Open your console and run this. It will log out all of the links with "/test/" in. You said that you were looking for links that contain "/test/". The other answers I have seen only match for links starting with "/test/".
Bear in mind that this will pull out all of the matching links, not just one so you will be returned an array.