![]() ![]() filter(e => e.match(/" & regexPattern & "/i)).The link extractor tool serves to grab all links from a website or extract links on a specific webpage, including internal links and internal backlinks, internal backlinks anchors, and external outgoing links for every URL on the site. Set jsCmdStr to "om(document.links, x => x.href) On extract_Href_Links_Safari(regexPatternStr) Set AppleScript's text item delimiters to oldTIDS ORANGE - Actions that permanently destroy Varibles or Clipboards YELLOW - Primary Actions (usually the main purpose of the macro) MAGENTA - Actions designed to be customized by user GREEN - Key Comments designed to highlight main sections of macro To facilitate the reading, customizing, and maintenance of this macro, ![]() This macro uses Google Chrome, but can be easily changed.Any Action in magenta color is designed to be changed by end-user.Using RegEx, parses it into Title and URL.Returns a TAB delimited String, with each link on a separate line.Builds a TAB delimited list (array) of Link Text & URL from that collection.Gets a HTML Collection of all Links (Anchor Tags) within that collection.Gets a HTML Collection of all Elements that have the specified Class Name.If your web page has a lot of links, it is best to first TEST on a similar page with just a few links).ADD Actions at the bottom of the Macro to process each link as you desire.Set the below Action "SET HTML Class" to the unique Class of the HTML Element that contains each, or all, of the list of links.Set the below Action "SET Source URL" to the URL of the Web Page that contains the list of links.(Note: This macro can be used ONLY with Google Chrome, but could be easily changed to use Safari, just by replacing the Chrome Actions with Safari Actions).Move Macro to Macro Group that limits trigger to apps you plan to use it with.In some cases, they MUST be changed to fit your specific requirements. Note that all Actions with the magenta color are designed to be changed by you. Extract Web Page Links Using HTML Class, and Process Each Link Just post the URL of the target page.Īuthor. If it does not work for you, we can probably figure out a method that will. This method/macro won't work in all cases, but hopefully it will in most cases. You can easily find this HTML element, and its Class, by using the Inspector in either Chrome or Safari. Most often, these list of links will either be within a major HTML element with a unique Class, or each link will be within an element that has the same Class for all of these elements. None of which requires the user to understand or change JavaScript. Make it easy for most users, most use cases, to extract all hyperlinks in a list on a web page, and then process each link. ![]() It is provided as an example of how you can use submacros with this macro.īe sure to read the Macro Setup in the Release Notes section below. This macro uses (but does not require) this Process a Web Page Hyperlink (28.6 KB) VER: 1.1 Extract & Process Links on Web Page Using HTML Class. MACRO: Extract & Process Links on Web Page Using HTML Class ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |