• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HTML parsing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML parsing


  • Subject: Re: HTML parsing
  • From: "Stockly, Ed" <email@hidden>
  • Date: Thu, 09 Jun 2016 18:33:09 +0000
  • Thread-topic: HTML parsing

Something like this will get you the dates. Is that what you're trying to
extract?

—————
set AppleScript's text item delimiters to {"<A href=\"#\"onclick=\""}
—Assumes the raw html text is in the variable "myText"
set myText to the rest of text items of myText
set listOfResults to {}
repeat with thisItem in myText
	set AppleScript's text item delimiters to {"</a>"}

	set insideTag to text item 1 of thisItem as text
	set AppleScript's text item delimiters to {">"}
	set the end of listOfResults to the last text item of insideTag

end repeat


Return listOfResults






On 6/9/16, 4:14 AM,
"applescript-users-bounces+ed.stockly=email@hidden on
behalf of William Dockery"
<applescript-users-bounces+ed.stockly=email@hidden on
behalf of email@hidden> wrote:

>
>Hello, I am an intermediate AppleScripter, and I am starting to use
>JavaScript to scrape websites for my personal use.  I have learned how to
>select elements by element ID.  But I have not yet learned how to select
>a list of HTML snippets that share a certain pattern of tags or tag
>values.
>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Follow-Ups:
    • Re: HTML parsing
      • From: Deivy Petrescu <email@hidden>
References: 
 >Re: HTML parsing (From: William Dockery <email@hidden>)

  • Prev by Date: Re: HTML parsing
  • Next by Date: Re: HTML parsing
  • Previous by thread: Re: HTML parsing
  • Next by thread: Re: HTML parsing
  • Index(es):
    • Date
    • Thread