0

I wonder how I can scrape how I can scrape of author affiliation from a page like this:

http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=1701938

The information that I want is stored in a meta-tag that looks like this:

<meta name="citation_author_institution" content="Department of Computing Science, University of Alberta"> 

I tried something like this:

var affiliation = doc.getElementsByTagName('meta').item(property='citation_author_institution');

But this didn't seem to work for me. Can someone enlighten please

9
  • 1
    This works for me in Chrome: document.getElementsByTagName('meta')['citation_author_institution'] Commented Oct 28, 2015 at 8:12
  • Okay, how do you check if it works? I'm maybe doing something wrong when I check Commented Oct 28, 2015 at 8:23
  • 1
    Here's a quick demo: jsfiddle.net/ak53zyks Commented Oct 28, 2015 at 8:25
  • 1
    That's the element itself (e.g. document.getElementsByTagName('meta')['citation_author_institution']) and not one of the properties (e.g. document.getElementsByTagName('meta')['citation_author_institution'].content - note the .content at the end) Commented Oct 28, 2015 at 9:33
  • 1
    Yes, then you get the content of the property content. If it's <meta name="abc" description="def"> you'd need document.getElementsByTagName('meta')['abc'].description Commented Oct 28, 2015 at 9:41

1 Answer 1

1

Thx to the user Reeno, I finally got the content of this meta tag that I needed. Here is the final code:

var affiliation = doc.getElementsByTagName('meta')[property='citation_author_institution'].content;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.