Html suppress certain tags when extracting

tried on a new workflow, doesnt remove the content

Share the input of this node.

ok, so different workflow but the same code

ok so use the data from here as the input data: https://pastebin.com/pxwMiQ6J
password: K6uLNpFyXs

it’s coming from an IF node with the JSON output looking like this

and then link that to a function node with the following code

const regex = /<img .*?>| <a .*?<\/a><br>/gm;

const response = [];

for (const item of items) {
  const content = item.json.Content;
  const matched = content.match(regex);
  response.push({
    json: {
     content: Array.isArray(matched) ? content.replace(matched[0], '') : content
//testing-if-this-works-but-still-no      content: content.replace(matched, '')
    }
  })
}

return response;

as far as i can see my regex is working ok at picking up what i want to remove in this workflow

I need the output of the IF2 node (as shown in the picture above) not the whole HTML. The first 3 items should be more than enough.

ok

[
{

"Content": "<strong>Type</strong> Public company<br> <strong>Industry</strong> Financial Services<br> <strong>Founded</strong> January 2000<br> <strong>Headquarters</strong> Gurgaon, India<br> <strong>Key people</strong><br> Sameer Gehlaut(Chairman &amp; Founder)<br> Gagan Banga (Vice-Chairman &amp; MD)<br> <strong>Products</strong> Financial Services, Real Estate, Pharmaceutical, Construction Equipment Leasing, LED Lights and Facilities sector<br> <strong>Revenue</strong> ₹ 25,000 crore (2019)<br> <strong>Number of employees</strong> 19,000 (2019)<br> <strong>Website</strong> www.Indiabulls.com<br> <br> <strong>FILES PART 1</strong> FILES: 1334 SIZE: 4.75GB<br> <img alt="" src="/user/pages/05.indiabulls-com/Screenshot_32.png"><br><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/IB/IB.7z">DOWNLOAD</a> <br> <br> <br> <br> <br> <br> <br> <br> <strong>FILES PART 2</strong> EMAIL CORRESPONDENCE TOTAL:118356 emails SIZE: 49.5 GB<br> <img alt="" src="/user/pages/05.indiabulls-com/Screenshot_33.png"><br><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/IB/MAIL.7z.001">DOWNLOAD PART1</a> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/IB/MAIL.7z.002">DOWNLOAD PART2</a> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <strong>FILES PART 3</strong> TOTAL:13497 FILES SIZE:31.6 GB<br> <img alt="" src="/user/pages/05.indiabulls-com/Screenshot_41.png"><br><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/IB/IB2.7z">DOWNLOAD</a> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <strong>Screenshots:</strong><br> <img alt="" src="/user/pages/05.indiabulls-com/Screenshot_31.png"><br><img alt="" src="/user/pages/05.indiabulls-com/Screenshot_30.png"><br><img alt="" src="/user/pages/05.indiabulls-com/Screenshot_29.png"><br><img alt="" src="/user/pages/05.indiabulls-com/Screenshot_28.png"><br><img alt="" src="/user/pages/05.indiabulls-com/Screenshot_27.png"><br> <img alt="" src="/user/pages/05.indiabulls-com/Screenshot_26.png">"

},

{

"Content": "<strong>Headquarters</strong>: Darmstadt , Germany<br> <strong>Management team</strong>:<br> Sanjay Brahmawar, CEO<br> Elke Frank<br> Arnd Zinnhardt<br> John Schweitzer<br> Stefan Sigg<br> Andreas Bereczky , chairman of the supervisory board<br> <strong>Number of employees</strong>: 4,948 (2019) <br> <strong>Revenue</strong>: 891 million euros (2019) <br> <strong>Website</strong>: softwareag.com<br> <br><br>"

},

{

"Content": "<strong>Headquarters:</strong><br> 4808 - 12th St NE, Calgary, Alberta, T2E 4R4, Canada<br> <strong>Phone:</strong><br> (403) 567-2500<br> <strong>Website:</strong><br> www.parkland.ca<br> <strong>Employees:</strong><br> 3,051<br> <strong>Revenue:</strong><br> $17 Billion<br> <strong>Stock Symbol:</strong><br> PKI<br> <br> <strong>Want to delete files? Email: [email protected] [email protected]</strong> <br> <strong>FILES:</strong><br> <strong>PART1</strong> 10.11.30.36\share\Group_Directories\Area 2 Operations\Confidental <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Confidential.zip">DOWNLOAD</a><br> <strong>PART2</strong> 10.11.30.36\share\Group_Directories* SIZE: 62.2GB<br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z01">DOWNLOAD1</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z02">DOWNLOAD2</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z03">DOWNLOAD3</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z04">DOWNLOAD4</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z05">DOWNLOAD5</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z06">DOWNLOAD6</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z07">DOWNLOAD7</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z08">DOWNLOAD8</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z09">DOWNLOAD9</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z10">DOWNLOAD10</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z11">DOWNLOAD11</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.z12">DOWNLOAD12</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/Group_Directories.zip">DOWNLOAD13</a><br> <br> <strong>PART3</strong> 10.11.30.36\share\Group_Directories\CAD - Everything except the DWGS folder SIZE: 19.4GB<br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/CAD.z01">DOWNLOAD1</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/CAD.z02">DOWNLOAD2</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/CAD.z03">DOWNLOAD3</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/CAD.z04">DOWNLOAD4</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/CAD.zip">DOWNLOAD5</a><br> <br> and DWGS folder SIZE 447 GB <br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z01">DOWNLOAD1</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z02">DOWNLOAD2</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z03">DOWNLOAD3</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z04">DOWNLOAD4</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z05">DOWNLOAD5</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z06">DOWNLOAD6</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z07">DOWNLOAD7</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z08">DOWNLOAD8</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z09">DOWNLOAD9</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z10">DOWNLOAD10</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z11">DOWNLOAD11</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z12">DOWNLOAD12</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z13">DOWNLOAD13</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z14">DOWNLOAD14</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z15">DOWNLOAD15</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z16">DOWNLOAD16</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z17">DOWNLOAD17</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z18">DOWNLOAD18</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z19">DOWNLOAD19</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z20">DOWNLOAD20</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z21">DOWNLOAD21</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z22">DOWNLOAD22</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z23">DOWNLOAD23</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z24">DOWNLOAD24</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z25">DOWNLOAD25</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z26">DOWNLOAD26</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z27">DOWNLOAD27</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z28">DOWNLOAD28</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z29">DOWNLOAD29</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z30">DOWNLOAD30</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z31">DOWNLOAD31</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z32">DOWNLOAD32</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z33">DOWNLOAD33</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z34">DOWNLOAD34</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z35">DOWNLOAD35</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z36">DOWNLOAD36</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z37">DOWNLOAD37</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z38">DOWNLOAD38</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z39">DOWNLOAD39</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z40">DOWNLOAD40</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z41">DOWNLOAD41</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z42">DOWNLOAD42</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z43">DOWNLOAD43</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z44">DOWNLOAD44</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z45">DOWNLOAD45</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z46">DOWNLOAD46</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z47">DOWNLOAD47</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z48">DOWNLOAD48</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z49">DOWNLOAD49</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z50">DOWNLOAD50</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z51">DOWNLOAD51</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z52">DOWNLOAD52</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z53">DOWNLOAD53</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z54">DOWNLOAD54</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z55">DOWNLOAD55</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z56">DOWNLOAD56</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z57">DOWNLOAD57</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z58">DOWNLOAD58</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z59">DOWNLOAD59</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z60">DOWNLOAD60</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z61">DOWNLOAD61</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z62">DOWNLOAD62</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z63">DOWNLOAD63</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z64">DOWNLOAD64</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z65">DOWNLOAD65</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z66">DOWNLOAD66</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z67">DOWNLOAD67</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z68">DOWNLOAD68</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z69">DOWNLOAD69</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z70">DOWNLOAD70</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z71">DOWNLOAD71</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.z72">DOWNLOAD72</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/DWGS.zip">DOWNLOAD73</a><br> <br> <strong>PART4</strong> \10.11.30.36\share* SIZE: 132GB FILES: 110237<br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z01">DOWNLOAD1</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z02">DOWNLOAD2</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z03">DOWNLOAD3</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z04">DOWNLOAD4</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z05">DOWNLOAD5</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z06">DOWNLOAD6</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z07">DOWNLOAD7</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z08">DOWNLOAD8</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z09">DOWNLOAD9</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z10">DOWNLOAD10</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z11">DOWNLOAD11</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z12">DOWNLOAD12</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z13">DOWNLOAD13</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z14">DOWNLOAD14</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z15">DOWNLOAD15</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z16">DOWNLOAD16</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z17">DOWNLOAD17</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z18">DOWNLOAD18</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z19">DOWNLOAD19</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z20">DOWNLOAD20</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z21">DOWNLOAD21</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z22">DOWNLOAD22</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z23">DOWNLOAD23</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z24">DOWNLOAD24</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z25">DOWNLOAD25</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.z26">DOWNLOAD26</a><br> <a href="http://3ws3t4uo7fehnn4qpmadk3zjrxta5xlt3gsc5mx4sztrsy7ficuz5ayd.onion/PARK/share.zip">DOWNLOAD27</a><br> <br> <strong>PART5</strong><br>"

}
]

In those 3 items the class cz-related-article-wrapp does not exist. Which the part you want to remove right?

no, i said this was a different flow but the same code, except the regex

const regex = /<img .*?>| <a .*?<\/a><br>/gm;

The issue was with the matches. In this new example, you have multiples matches, and in the old one, just one match. So, I adjusted the code to “support” multiple matches. There is probably a better way to do this, but let’s say regex it’s not the easiest thing to work with :joy:

const regex = /<img .*?>| <a .*?<\/a><br>/gm;

const response = [];


for (const item of items) {
  let content = item.json.Content;
  const matched = content.match(regex);
  if (Array.isArray(matched)) {
    for (const match of matched) {
      content = content.replace(match, '')
    }
  }
  
  response.push({
    json: {
     content,
     }
  })
}

return response;
Example workflow

i took your workflow and it still doesn’t remove the items, is there something wrong with the docker image I am using maybe, maybe some bug?
image

if there is a better way I’m all for it. When I scrape the web pages I don’t want to be offering compromised victims PII material via the href links, so trying to strip them out, if that makes sense.

I meant there is a better way to code that function node. If it’s not removed, it means that the regular expression is not matching that part. If you print matched in the function node you will see what the regular expression is matching.

ok will see what happens, thanks so much for the help with this. I’ve learnt so much javascript over the last month or so but there is loads I don’t know still and this forums help is indispensable

No problem. We are happy to help. It makes sense to have a text replace node, where you can provide the regular expression and for what you want to replace the match. That way, we get the javascript part off the equation.

A text replace node would be amazing

it’s def not stripping the content out, what other options do you have in mind that I can use?

i think the issue is with the regex A | regex B

using just one part of it seems to work.

So the pipe | doesn’t seem to be taken into account

EDIT: actually i think it only stripe out the first finding, not all of them from the content

ok, so THIS DOESNT WORK, but you get the idea, can it not be split into 2 if statements to cover both the regex?

const regex = /<img .*?>/gm;
const regex2 =/<a .*?<\/a><br>/gm;
const response = [];


for (const item of items) {
  let content = item.json.Content;
  const matched = content.match(regex);
  if (Array.isArray(matched)) {
    for (const match of matched) {
      content = content.replace(match, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
    }
  }
   
}

for (const item of items) {
  let content = item.json.Content;
  const matched2 = content.match(regex2);
  if (Array.isArray(matched2)) {
    for (const match of matched2) {
      content = content.replace(match, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
    }
  }
  
  response.push({
    json: {
     content,
     }
  })
}

return response;

It does not work because you are using two loops. It is best to use only one loop for this. (In each loop you read the data again: let content = item.json.Content;)
Also, the data is written to the response only in the second loop.
Just try to put content = content.replace(match, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') into the second loop, using content = content.replace(match, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')

1 Like

cheers will have a go.

javascript i’ve only started learning in the last few months since using n8n, making progress but not enought yet :wink:

EDIT: yeah, still unable to get it to work, but i think this is possibly the only way i will get it to work, but splitting the regex and replace into 2 separate calls.

ok this seems to have fixed it, it didnt like the regex

const regex2 = /<img .*?>/gm;
const regex = /<a[^>]*>(.*?)<\/a>/gm;


const response = [];

for (const item of items) {
  let content = item.json.Content;
  const matched = content.match(regex);
  const matched2 = content.match(regex2);
  if (Array.isArray(matched)) {
    for (const match of matched) {
      content = content.replace(match, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
      if (Array.isArray(matched2)) {
    for (const match2 of matched2) {
            content = content.replace(match2, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
    }
    }
  }
  
  response.push({
    json: {
     content,
     }
  })
}}

return response;

I’m glad you fix it and hope you learn a little bit :slight_smile:
Now i also clean up your code, because you don’t need to match if you just want to replace some stuff with regex:

const regex = /<img .*?>/gm;
const regex2 =/<a .*?<\/a><br>/gm;

const response = [];

for (const item of items) {
  let content = item.json.Content;
  content = content.replace(regex, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
  content = content.replace(regex2, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
  
  response.push({
    json: {
     content,
     }
  })
}

return response;
3 Likes