Web scraping Applescript-检查URL列表是否包含列表中的这些单词

Web scraping Applescript-检查URL列表是否包含列表中的这些单词,web-scraping,applescript,Web Scraping,Applescript,我有两张单子。列表A包含URL,列表B包含单词。我需要返回包含任何单词筛选的每个URL 我已经设法检查了真/假,但没有返回包含任何单词的URL set theURLs to {"www.audi.com", "www.vw.com", "www.suzuki.com"} as text set KeywordFilter to {"dodge", "audi", "chevy"} set doesContain to containsItems from KeywordFilter agains

我有两张单子。列表A包含URL,列表B包含单词。我需要返回包含任何单词筛选的每个URL

我已经设法检查了真/假,但没有返回包含任何单词的URL

set theURLs to {"www.audi.com", "www.vw.com", "www.suzuki.com"} as text
set KeywordFilter to {"dodge", "audi", "chevy"}
set doesContain to containsItems from KeywordFilter against theURLs


on containsItems from qList against theText
    set pageURLs to {}
    repeat with anItem in qList
        if theText contains anItem then return true
    end repeat
    return false
end containsItems
我是否需要另一个循环以字符串形式返回匹配的URL


谢谢大家的帮助。

将列表强制为文本

set theURLs to {"www.audi.com", "www.vw.com", "www.suzuki.com"} as text
这是个坏主意,结果是——取决于文本项分隔符——www.audi.comwww.vw.comwww.suzuki.com

要比较两个列表,需要两个循环


谢谢。我只需要更改行:如果aText包含anItem,则将页面结束URL设置为anItem的内容;如果aText包含anItem,则将页面结束URL设置为aText的内容,因为我需要返回URL,而不是过滤器/关键字。Liebe Grüsse aus Zürich由于pageURLs的值在ContainesSitems操作之外不可用,我如何替换ON和END以保持在同一工作流中?感谢您FoundUrls代表返回页面URL的结果。要删除整个处理程序,请在…上删除,返回。。。最后。。。行,并用关键字过滤器替换处理程序中出现的qList,用URL替换文本。
set theURLs to {"www.audi.com", "www.vw.com", "www.suzuki.com"}
set KeywordFilter to {"dodge", "audi", "chevy"}
set foundURLs to containsItems from KeywordFilter against theURLs

on containsItems from qList against theText
    set pageURLs to {}
    repeat with aText in theText
        repeat with anItem in qList
            if aText contains anItem then set end of pageURLs to contents of anItem
        end repeat
    end repeat
    return pageURLs
end containsItems