# 💻developers


03/06/2024, 9:21 AM
What is wrong on this script for code execution card?
Copy code
// parse HTML code
await axios
  .then((response) => {
    const html =

    const regex = /<div.*?data-permalink-url="(.*?)".*?>/g
    let matches
    const permalinks = []

    while ((matches = regex.exec(html)) !== null && permalinks.length < 20) {

    workflow.pubmedSr_array = permalinks
  .catch((error) => {
    console.error('An error occurred while getting or processing the HTML:', error)
i already have the necessary workflow variables and I have a text card after code execution that prints the array
My goal is to retrieve the full HTML code from "" where is my workflow variable 'rawQuery'. After retrieving the HTML source, the script must parse, from the first 20 divs that meet the condition of having the attribute "data-permalink-url", the value of that attribute (in example: data-permalink-url=''). Each time the script takes one value from one div, it must store that inside a my array, a workflow variable called: pubmedSr_array