Need help with code snippet

I’m trying to grab the stock ticker symbols from a website and use them to open a page for each one in separate tab in the same window of my browser…

The source I use is here:
https://www.marketwatch.com/tools/screener/stock?exchange=all&skip=0&orderbyfield=ChangePercent&direction=desc&visiblecolumns=Symbol,CompanyName,Price,NetChange,ChangePercent,Volume&pricemin=10&changepercentmin=10&volumemin=100000

Once I open that page I select a bookmark in my browser (Safari) but instead of opening another webpage, it executes the following javascript:

javascript:(function()%7Bdocument.querySelectorAll('td.j-Symbol:first-of-type%20a').forEach(a%20=%3E%20window.open(%22http://bigcharts.marketwatch.com/quickchart/quickchart.asp?symb=%22+a.text,%20'_blank'));%7D)();

Unfortunately, the code stopped working recently and all the new tabs don’t open any more. I suspect that MarketWatch changed the code for their website. Can anyone figure out what’s missing now?

TIA!!

Hello, If your using Safari this could be the issue try another browser.

Thanks for the reply but I know that Safari is not the issue. The script worked for a long time (years) without issue. I think that MarketWatch tweaked the code on their page and now my code is not picking up the right bits to give me what I want anymore but I can’t figure it out.

The code works for me (in Chrome).

Make sure the browser isn’t blocking pop-ups for that domain.

lasjorg, how many new tabs open up for you?

As many as there are items in the list, but I have to allow the pop-ups, otherwise Chrome blocks them.

I know for sure the code is working, it gets the link text of each list (table) item and uses that to construct the URLs it opens. The selector works, as does the constructed URL.