1

If I want to pull all the actors' names, I tried this, but it only pulls one name. Is there a repeat loop or anything else I can do to have it pull all the tags that say <span itemprop="name">?

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

1 Answer 1

1

Try:

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'")
Sign up to request clarification or add additional context in comments.

1 Comment

I'm sorry to ask this again, but doing that gets me the directors and producers as well. If I only wanted it to get me actors, is there a way to further grep that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.