• 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: Parsing web pages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing web pages


  • Subject: Re: Parsing web pages
  • From: Christopher Stone <email@hidden>
  • Date: Mon, 02 Nov 2015 01:55:57 -0600

On Nov 02, 2015, at 00:05, DaveC <email@hidden> wrote:
I want to collect some text (either in text format or screenshot) of web pages on one web site.
______________________________________________________________________

Hey Dave,

It's probably doable, but I can't say for sure without seeing the site.

I’d like to input this data into a spreadsheet, preferably into specific fields of an existing sheet. 

Impossible to speculate.  What spreadsheet app?

Excel is doable.  Numbers?  Maybe.  OpenOffice.  Nope.  LibreOffice?  Nope.

Here's a little code to get you started.

-------------------------------------------------------------------------
tell application "Finder" to set desktopBounds to bounds of window of desktop
set item 2 of desktopBounds to 23

tell application "Safari"
  tell front document
    set pageText to its text
    set pageSource to its source
  end tell
end tell

tell application "BBEdit"
  make new text window with properties {text:pageText, bounds:desktopBounds}
  make new text window with properties {text:pageSource, bounds:desktopBounds}
end tell
-------------------------------------------------------------------------

If you don't have BBEdit then download its freeware sibling TextWrangler and change BBEdit in the script to TextWrangler.

What version of OSX are you using?

--
Best Regards,
Chris

 _______________________________________________
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: Parsing web pages
      • From: Christopher Stone <email@hidden>
References: 
 >Parsing web pages (From: DaveC <email@hidden>)

  • Prev by Date: Re: El Capitan and Log-In Applets
  • Next by Date: Re: Parsing web pages
  • Previous by thread: Parsing web pages
  • Next by thread: Re: Parsing web pages
  • Index(es):
    • Date
    • Thread