1
<meta name="keywords" content="Ruby On Rails (Software), Authentication (Software Genre), Tutorial (Industry), howto, tips, tricks">

How can I get content value from this meta tag using PyQuery?

from pyquery import PyQuery

def get_data(myurl):
    query = PyQuery(url=myurl)
    title = query("title").text()
    keyword = query("meta[name=keywords]").text()
    ...
netman97
  • 111
  • 1
  • 1
  • 6
  • 1
    `query("meta[name=keywords]")[0].attr('content')`? Does this work?(http://pythonhosted.org/pyquery/attributes.html) – koffein Dec 04 '13 at 18:07

1 Answers1

1

You've almost made it, missing apostrophe character to set the keywork

keyword = query("meta[name='keywords']").text()
rat
  • 1,277
  • 16
  • 24