Was able to scrape all the text information I needed from a website with a page text extraction script and regular expression, but will need Javascript for scraping a link, which I unfortunately don't know yet.
The site is linkedin's sales navigator which is behind a pay wall so unfortunately can't link the website but I'll do my best to provide the necessary source html, please let me know if and where I can provide more context.
I'm trying to scrape the google maps link highlighted in the picture below.
Is there some reason this RegEx won't work for you:
Are there different definitions of page text? The script I was running to retrieve page text didn't retrieve any code, it only retrieved text that you could see on first glance at a page. This is the javascript
document.body.parentNode.outerText
and the result would be something like this:
Mediatonic Games
Mediatonic is one of the UK's largest independent game developers with over 200 people acr.. See all
Computer Games - United Kingdom - 201-500 employees
170 employees
|
24 Decision Makers
Add Tag
Save
Website
Headquarters
Very similar html except topcard_employees, I'm struggling with formatting the script for the class="ember-view" portion, how would I do that? Goal is to retrieve the "76,679 employees"
Thankyou! I was able to scrape many more items with this format. Sorry to bombard you with questions but what would be the syntax when there's a prefix?
text = document.querySelector('span[class="ng-star-inserted"]').innerText;
text
But there's some sort of prefix ( I don't know the exact terminology but the _ngcontent-c22 ) and unfortunately the class "ng-star-inserted" is not the first in the html. It looks like this
None of them worked unfortunately, I believe the problem might be stemming from the fact that this source is a chrome extension that pops out a panel, instead of the actual website.
Here's the larger code ( this page is different from the code I listed above )
Well, we can stop right there. Due to "security" reasons, Chrome prevents JavaScript injection in extensions and frames. I've got JavaScript to work with those in the Chrome console, but never from AppleScript or KM.