2

I'm looking to find the font-family used for a specific element (like h1) on a given page. I'm using node js npm crawler to go through an list of 50 or more sites. In my first attempt I used:

$( "h1" ).css( "font-family" );  

However this will only get inline styles which most sites don't use for fonts. I have looked into other methods like window.getComputedStyle and this one but these methods (and similar ones) use window and document which I don't think are supported in node. They also might use id and class to select the elements which I will not have as I will be crawling multiple sites. Any suggestions?

Community
  • 1
  • 1

1 Answers1

1

You should be able to use PhantomJS to achieve this.

cobberboy
  • 5,598
  • 2
  • 25
  • 22