@YounesGa To have each thread use only 1 line, set the value "max success usage: 1", "max number of simultaneous use: 1".
This is equivalent to the fact that after the flow finishes running with a result of Success, the already used proxy line will not be used again, whereas if there is an error, it will be reused 999999999 times and only one line. for each stream
290a12f6-98cf-4378-9d4c-72a246339adb-image.png
looking for keywords that appear in a link or in a text.
-
I want to use JavaScript to solve the problem of finding keywords on a web page. I open a web page and want to check 3 requirements:
- Does the keyword appear in the anchor text or title of any link?
- Does the keyword appear in the text outside the links on the page?
- Case sensitivity should be ignored.
I have tried many different ways, but I still encounter an issue with the following case:
Example text to check: "Vietnam"
Keyword to check: "vi"
The methods I tried all resulted in: "true"However, I want the result to be "false" when the keyword is a part of another word. Please help me.
// Lấy nội dung của trang web và chuyển về chữ thường
var pageContent = document.body.innerHTML.toLowerCase();// Từ khoá cần kiểm tra và chuyển về chữ thường
var keyword = [[KEY_SEARCH]];// Tạo biểu thức chính quy để kiểm tra từ khoá trong các liên kết và anchor text
var linkRegex = new RegExp(>[^<]\b${keyword}\b[^<]<a[^>]>|>[^<]\b${keyword}\b[^<]*</a>, 'ig');// Kiểm tra từ khoá trong các liên kết và anchor text
var keywordInLinks = linkRegex.test(pageContent);// Loại bỏ các thẻ <a> sau khi đã kiểm tra
var pageContentWithoutLinks = pageContent.replace(linkRegex, ">");// Kiểm tra từ khoá trong văn bản ngoài các liên kết (với word boundary)
var keywordInText = new RegExp(\b${keyword}\b, 'g').test(pageContentWithoutLinks);[[XUAT_HIEN_TRONG_LINK]] = keywordInLinks
[[XUAT_HIEN_TRONG_VAN_BAN]] = keywordInText