document.getElementsByClassName
Returns an array of all child elements which have any of the given
class names. When called on the document object, the complete document
is searched, including the root node. You may also call
getElementsByClassName() on any element; it will return only elements
which are descendants of the specified root element with the given
class names.
And,
window.location.href is a property that will tell
you the current URL location of the browser. Setting the property to
something different will redirect the page
window.location.href = actualItemLinks; // will redirect your page immediately when you assign some url to it
Probably what you are looking for is,
var elements = document.getElementsByClassName("item title_link"); // Get all elements that have both the 'item' and 'title_link' classes.It will return node list of elements.
var itemLinksHRefs = elements[0].href; // pick first hyperlinks href attr.
var actualItemHRefs = itemLinksHRefs.replace("#","");
var actualItemLinks = "http://www.domainname.com/index/" + actualItemHRefs + "/get";
window.location.href = actualItemLinks;