通过Applescript解析HTML中的多个标记

通过Applescript解析HTML中的多个标记,applescript,Applescript,如果我想拉所有演员的名字,我试过这个,但它只拉一个名字。是否有一个重复循环或任何其他我可以做的事情,让它拉所有标签说 set astid to AppleScript's text item delimiters set startHere to "<span itemprop=\"name\">" set stopHere to "</span>" set mysource_html to do shell script "curl https://play.goog

如果我想拉所有演员的名字,我试过这个,但它只拉一个名字。是否有一个重复循环或任何其他我可以做的事情,让它拉所有标签说

set astid to AppleScript's text item delimiters

set startHere to "<span itemprop=\"name\">"
set stopHere to "</span>"
set mysource_html to do shell script "curl https://play.google.com/store/movies/details?id=H9EKG4-JHSw"
set AppleScript's text item delimiters to startHere
set blurb1 to text item 2 of mysource_html
set AppleScript's text item delimiters to stopHere
set blurb2 to text item 1 of blurb1

set AppleScript's text item delimiters to astid
将astid设置为AppleScript的文本项分隔符
将startHere设置为“”
将stopHere设置为“”
将mysource_html设置为执行shell脚本“curl”https://play.google.com/store/movies/details?id=H9EKG4-JHSw“
将AppleScript的文本项分隔符设置为startHere
将blurb1设置为mysource_html的文本项2
将AppleScript的文本项分隔符设置为stop here
将blurb2设置为blurb1的文本项1
将AppleScript的文本项分隔符设置为astid
试试:

将{TID,文本项分隔符}设置为{text item delimiters,{“Actors”,“Producers”}
将mysource_html设置为(do shell脚本“curl”)的文本项2https://play.google.com/store/movies/details?id=H9EKG4-JHSw”)
将文本项分隔符设置为TID
将mysource_html设置为的每个段落(是否使用shell脚本“echo”和mysource_html的引用形式&“grep-Eo”[^//g'))
试试:

将{TID,文本项分隔符}设置为{text item delimiters,{“Actors”,“Producers”}
将mysource_html设置为(do shell脚本“curl”)的文本项2https://play.google.com/store/movies/details?id=H9EKG4-JHSw”)
将文本项分隔符设置为TID
将mysource_html设置为的每个段落(是否使用shell脚本“echo”和mysource_html的引用形式&“grep-Eo”[^//g'))

我很抱歉再次问这个问题,但这样做也会让我得到导演和制片人。如果我只想让我成为演员,有没有办法进一步提高这一点?谢谢!我感谢你的帮助。我很抱歉再次问这个问题,但这样做也会让我成为导演和制片人。如果我只想让我成为演员,有没有办法让我成为演员谢谢你,谢谢你的帮助。
set {TID, text item delimiters} to {text item delimiters, {"<td class=\"credit-label\">Actors</td>", "<td class=\"credit-label\">Producers</td>"}}
set mysource_html to text item 2 of (do shell script "curl https://play.google.com/store/movies/details?id=H9EKG4-JHSw")
set text item delimiters to TID

set mysource_html to every paragraph of (do shell script "echo " & quoted form of mysource_html & " | grep -Eo '<span itemprop=\"name\">[^<]*' | sed 's/.*>//g'")