Make נוסחא שמוציאה את הקישורים מhtml

  • הוסף לסימניות
  • #1
היי כולם,
אני צריך רעיון לנוסחא או משהו שמוציאה מhtml ארוך (שמגיע מדף אינטרנט) את כל הקישורים שנמצאים בה

אם יש למישהו פתרון אשמח מאוד
 
  • הוסף לסימניות
  • #2
פיצול על סמך "https" לא עושה את העבודה?
 
  • הוסף לסימניות
  • #3
אני צריך גם לדעת מה האורך של כל קישור
 
  • הוסף לסימניות
  • #4
  • הוסף לסימניות
  • #5
  • הוסף לסימניות
  • #7
יש לי משהו לא בנוסחא, ולא למייק... אולי יעזור לך...

יש לשנות את כתובת האתר במקום
קוד:
https://www.prog.co.il/


HTML:
<!DOCTYPE html>
<html>
<head>
  <title>Links Extractor</title>
</head>
  <style>
    li {
      margin: 10px 0;
    }
  </style>
<body>
  <div class="container"></div>
  // כאן שמים את הסקריפט
 
</body>
</html>

JavaScript:
  <script>
async function extractLinks() {
  // Make a request to the website
  const response = await fetch('https://cors-anywhere.herokuapp.com/https://www.prog.co.il/');
  const html = await response.text();

  // Extract the links from the HTML
  const parser = new DOMParser();
  const doc = parser.parseFromString(html, 'text/html');
  const links = doc.querySelectorAll('a');
  const hrefs = Array.from(links).map(link => link.getAttribute('href'));

  // Display the links on the page
  const linkList = document.createElement('ul');
  hrefs.forEach(href => {
    const listItem = document.createElement('li');
    const linkElement = document.createElement('a');
    linkElement.setAttribute('href', href);
    linkElement.setAttribute('target', '_blank');
    linkElement.textContent = href;
    listItem.appendChild(linkElement);
    linkList.appendChild(listItem);
  });
  const container = document.querySelector('.container');
  container.appendChild(linkList);
}

extractLinks();

  </script>
 
  • הוסף לסימניות
  • #8
  • הוסף לסימניות
  • #9
לא בדיוק עוזר
@שמים חדשים הצלחת?
תנסה עם זה
1672057854423.png
 
  • הוסף לסימניות
  • #10
  • הוסף לסימניות
  • #11
לא בדיוק עזר
 
  • הוסף לסימניות
  • #13
  • הוסף לסימניות
  • #14
  • הוסף לסימניות
  • #15
אתה יכול להביא את הjson שלו?
JSON:
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 1,
                    "module": "http:ActionSendData",
                    "version": 3,
                    "parameters": {
                        "handleErrors": false,
                        "useNewZLibDeCompress": true
                    },
                    "mapper": {
                        "url": "https://www.prog.co.il/",
                        "serializeUrl": false,
                        "method": "get",
                        "headers": [],
                        "qs": [],
                        "bodyType": "",
                        "parseResponse": true,
                        "authUser": "",
                        "authPass": "",
                        "timeout": "",
                        "shareCookies": false,
                        "ca": "",
                        "rejectUnauthorized": true,
                        "followRedirect": true,
                        "useQuerystring": false,
                        "gzip": true,
                        "useMtls": false,
                        "followAllRedirects": false
                    },
                    "metadata": {
                        "designer": {
                            "x": 0,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "method": {
                                    "mode": "chose",
                                    "label": "GET"
                                },
                                "headers": {
                                    "mode": "chose"
                                },
                                "qs": {
                                    "mode": "chose"
                                },
                                "bodyType": {
                                    "label": "Empty"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "handleErrors",
                                "type": "boolean",
                                "label": "Evaluate all states as errors (except for 2xx and 3xx )",
                                "required": true
                            },
                            {
                                "name": "useNewZLibDeCompress",
                                "type": "hidden"
                            }
                        ],
                        "expect": [
                            {
                                "name": "url",
                                "type": "url",
                                "label": "URL",
                                "required": true
                            },
                            {
                                "name": "serializeUrl",
                                "type": "boolean",
                                "label": "Serialize URL",
                                "required": true
                            },
                            {
                                "name": "method",
                                "type": "select",
                                "label": "Method",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "get",
                                        "head",
                                        "post",
                                        "put",
                                        "patch",
                                        "delete",
                                        "options"
                                    ]
                                }
                            },
                            {
                                "name": "headers",
                                "type": "array",
                                "label": "Headers",
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Name",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Value",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "qs",
                                "type": "array",
                                "label": "Query String",
                                "spec": [
                                    {
                                        "name": "name",
                                        "label": "Name",
                                        "type": "text",
                                        "required": true
                                    },
                                    {
                                        "name": "value",
                                        "label": "Value",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "bodyType",
                                "type": "select",
                                "label": "Body type",
                                "validate": {
                                    "enum": [
                                        "raw",
                                        "x_www_form_urlencoded",
                                        "multipart_form_data"
                                    ]
                                }
                            },
                            {
                                "name": "parseResponse",
                                "type": "boolean",
                                "label": "Parse response",
                                "required": true
                            },
                            {
                                "name": "authUser",
                                "type": "text",
                                "label": "User name"
                            },
                            {
                                "name": "authPass",
                                "type": "password",
                                "label": "Password"
                            },
                            {
                                "name": "timeout",
                                "type": "uinteger",
                                "label": "Timeout",
                                "validate": {
                                    "max": 300,
                                    "min": 1
                                }
                            },
                            {
                                "name": "shareCookies",
                                "type": "boolean",
                                "label": "Share cookies with other HTTP modules",
                                "required": true
                            },
                            {
                                "name": "ca",
                                "type": "cert",
                                "label": "Self-signed certificate"
                            },
                            {
                                "name": "rejectUnauthorized",
                                "type": "boolean",
                                "label": "Reject connections that are using unverified (self-signed) certificates",
                                "required": true
                            },
                            {
                                "name": "followRedirect",
                                "type": "boolean",
                                "label": "Follow redirect",
                                "required": true
                            },
                            {
                                "name": "useQuerystring",
                                "type": "boolean",
                                "label": "Disable serialization of multiple same query string keys as arrays",
                                "required": true
                            },
                            {
                                "name": "gzip",
                                "type": "boolean",
                                "label": "Request compressed content",
                                "required": true
                            },
                            {
                                "name": "useMtls",
                                "type": "boolean",
                                "label": "Use Mutual TLS",
                                "required": true
                            },
                            {
                                "name": "followAllRedirects",
                                "type": "boolean",
                                "label": "Follow all redirect",
                                "required": true
                            }
                        ]
                    }
                },
                {
                    "id": 2,
                    "module": "regexp:HTMLParser",
                    "version": 1,
                    "parameters": {
                        "continueWhenNoRes": false
                    },
                    "mapper": {
                        "elementType": "a",
                        "html": "{{1.data}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 300,
                            "y": 0
                        },
                        "restore": {
                            "expect": {
                                "elementType": {
                                    "label": "Link (a)"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "continueWhenNoRes",
                                "type": "boolean",
                                "label": "Continue the execution of the route even if the module finds no matches",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "elementType",
                                "type": "select",
                                "label": "Element type",
                                "required": true,
                                "validate": {
                                    "enum": [
                                        "img",
                                        "a",
                                        "iframe"
                                    ]
                                }
                            },
                            {
                                "name": "html",
                                "type": "text",
                                "label": "HTML"
                            }
                        ],
                        "interface": [
                            {
                                "name": "element",
                                "label": "Element",
                                "type": "text"
                            },
                            {
                                "name": "innerContent",
                                "label": "Inner content",
                                "type": "text"
                            },
                            {
                                "name": "attrs",
                                "label": "Attributes",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "href",
                                        "label": "href",
                                        "type": "text"
                                    },
                                    {
                                        "name": "rel",
                                        "label": "rel",
                                        "type": "text"
                                    },
                                    {
                                        "name": "target",
                                        "label": "target",
                                        "type": "text"
                                    }
                                ]
                            }
                        ]
                    }
                },
                {
                    "id": 3,
                    "module": "util:TextAggregator",
                    "version": 1,
                    "parameters": {
                        "rowSeparator": "\t",
                        "feeder": 2
                    },
                    "mapper": {
                        "value": "      <tr>\n        <td><a href=\"{{2.attrs.href}}\" target=\"_blank\">{{2.attrs.href}}</a></td>\n      </tr>"
                    },
                    "metadata": {
                        "designer": {
                            "x": 600,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "rowSeparator": {
                                    "label": "Tab"
                                }
                            },
                            "extra": {
                                "feeder": {
                                    "label": "Text parser - Get elements from HTML [2]"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "rowSeparator",
                                "type": "select",
                                "label": "Row separator",
                                "validate": {
                                    "enum": [
                                        "\n",
                                        "\t",
                                        "other"
                                    ]
                                }
                            }
                        ],
                        "expect": [
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "advanced": true
                    }
                },
                {
                    "id": 4,
                    "module": "google-email:ActionSendEmail",
                    "version": 2,
                    "parameters": {
                        "account": 447688
                    },
                    "mapper": {
                        "from": "",
                        "to": [
                            "<לא ניתן לפרסם מיילים באופן פומבי>"
                        ],
                        "subject": "חילוץ קישורים",
                        "html": "<html dir=\"rtl\">\n  <head>\n    <style>\n      table {\n        border-collapse: collapse;\n      }\n      td {\n        border: 1px solid black;\n        padding: 10px;\n      }\n    </style>\n  </head>\n  <body>\n  <p>לכבוד:</p>\n<p>להלן הקישורים לתאריך: {{formatDate(now; \"DD/MM/YYYY HH:mm:ss\")}}</p>\n    <table>\n   {{3.text}}\n    </table>\n  </body>\n</html>\n",
                        "attachments": [],
                        "cc": [],
                        "bcc": []
                    },
                    "metadata": {
                        "designer": {
                            "x": 900,
                            "y": 0
                        },
                        "restore": {
                            "parameters": {
                                "account": {
                                    "label": "API GOOGLE (<לא ניתן לפרסם מיילים באופן פומבי>)",
                                    "data": {
                                        "scoped": "true",
                                        "connection": "google-restricted"
                                    }
                                }
                            },
                            "expect": {
                                "to": {
                                    "mode": "chose",
                                    "items": [
                                        null
                                    ]
                                },
                                "attachments": {
                                    "mode": "chose"
                                },
                                "cc": {
                                    "mode": "chose"
                                },
                                "bcc": {
                                    "mode": "chose"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "account",
                                "type": "account:google-restricted",
                                "label": "Connection",
                                "required": true
                            }
                        ],
                        "expect": [
                            {
                                "name": "from",
                                "type": "text",
                                "label": "From"
                            },
                            {
                                "name": "to",
                                "type": "array",
                                "label": "To",
                                "required": true,
                                "spec": {
                                    "name": "value",
                                    "type": "email",
                                    "label": "Email address",
                                    "required": true
                                }
                            },
                            {
                                "name": "subject",
                                "type": "text",
                                "label": "Subject"
                            },
                            {
                                "name": "html",
                                "type": "text",
                                "label": "Content"
                            },
                            {
                                "name": "attachments",
                                "type": "array",
                                "label": "Attachments",
                                "spec": [
                                    {
                                        "name": "fileName",
                                        "label": "File name",
                                        "type": "filename",
                                        "required": true,
                                        "semantic": "file:name"
                                    },
                                    {
                                        "name": "data",
                                        "label": "Data",
                                        "type": "buffer",
                                        "required": true,
                                        "semantic": "file:data"
                                    },
                                    {
                                        "name": "cid",
                                        "label": "Content-ID",
                                        "type": "text"
                                    }
                                ]
                            },
                            {
                                "name": "cc",
                                "type": "array",
                                "label": "Copy recipient",
                                "spec": {
                                    "type": "email",
                                    "label": "Email address",
                                    "name": "value"
                                }
                            },
                            {
                                "name": "bcc",
                                "type": "array",
                                "label": "Blind copy recipient",
                                "spec": {
                                    "type": "email",
                                    "label": "Email address",
                                    "name": "value"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}
 

פרוגבוט

תוכן שיווקי
פרסומת

הצטרפות לניוזלטר

איזה כיף שהצטרפתם לניוזלטר שלנו!

מעכשיו, תהיו הראשונים לקבל את כל העדכונים, החדשות, ההפתעות בלעדיות, והתכנים הכי חמים שלנו בפרוג!

לוח מודעות

הפרק היומי

הפרק היומי! כל ערב פרק תהילים חדש. הצטרפו אלינו לקריאת תהילים משותפת!


תהילים פרק כה

אלְדָוִד אֵלֶיךָ יי נַפְשִׁי אֶשָּׂא:באֱלֹהַי בְּךָ בָטַחְתִּי אַל אֵבוֹשָׁה אַל יַעַלְצוּ אֹיְבַי לִי:גגַּם כָּל קוֶֹיךָ לֹא יֵבֹשׁוּ יֵבֹשׁוּ הַבּוֹגְדִים רֵיקָם:דדְּרָכֶיךָ יי הוֹדִיעֵנִי אֹרְחוֹתֶיךָ לַמְּדֵנִי:ההַדְרִיכֵנִי בַאֲמִתֶּךָ וְלַמְּדֵנִי כִּי אַתָּה אֱלֹהֵי יִשְׁעִי אוֹתְךָ קִוִּיתִי כָּל הַיּוֹם:וזְכֹר רַחֲמֶיךָ יי וַחֲסָדֶיךָ כִּי מֵעוֹלָם הֵמָּה:זחַטֹּאות נְעוּרַי וּפְשָׁעַי אַל תִּזְכֹּר כְּחַסְדְּךָ זְכָר לִי אַתָּה לְמַעַן טוּבְךָ יי:חטוֹב וְיָשָׁר יי עַל כֵּן יוֹרֶה חַטָּאִים בַּדָּרֶךְ:טיַדְרֵךְ עֲנָוִים בַּמִּשְׁפָּט וִילַמֵּד עֲנָוִים דַּרְכּוֹ:יכָּל אָרְחוֹת יי חֶסֶד וֶאֱמֶת לְנֹצְרֵי בְרִיתוֹ וְעֵדֹתָיו:יאלְמַעַן שִׁמְךָ יי וְסָלַחְתָּ לַעֲוֹנִי כִּי רַב הוּא:יבמִי זֶה הָאִישׁ יְרֵא יי יוֹרֶנּוּ בְּדֶרֶךְ יִבְחָר:יגנַפְשׁוֹ בְּטוֹב תָּלִין וְזַרְעוֹ יִירַשׁ אָרֶץ:ידסוֹד יי לִירֵאָיו וּבְרִיתוֹ לְהוֹדִיעָם:טועֵינַי תָּמִיד אֶל יי כִּי הוּא יוֹצִיא מֵרֶשֶׁת רַגְלָי:טזפְּנֵה אֵלַי וְחָנֵּנִי כִּי יָחִיד וְעָנִי אָנִי:יזצָרוֹת לְבָבִי הִרְחִיבוּ מִמְּצוּקוֹתַי הוֹצִיאֵנִי:יחרְאֵה עָנְיִי וַעֲמָלִי וְשָׂא לְכָל חַטֹּאותָי:יטרְאֵה אוֹיְבַי כִּי רָבּוּ וְשִׂנְאַת חָמָס שְׂנֵאוּנִי:כשָׁמְרָה נַפְשִׁי וְהַצִּילֵנִי אַל אֵבוֹשׁ כִּי חָסִיתִי בָךְ:כאתֹּם וָיֹשֶׁר יִצְּרוּנִי כִּי קִוִּיתִיךָ:כבפְּדֵה אֱלֹהִים אֶת יִשְׂרָאֵל מִכֹּל צָרוֹתָיו:
נקרא  2  פעמים
למעלה