0

Is the <head> available through YQL?

I need to retrieve a Javascript variable that is set in the <head> of a page. When I do a query like

select * from html where url="http://www.google.com"

the returned data includes the <body> data, but no <head> data.

Is there a way to retrieve the <head> data through YQL?

by
1 Reply
  • Yep, by default a scrape through the HTML table returns the /html/body xpath content. You can return the <head> by modifying that xpath variable like so:

    CODE
    select * from html where url="http://www.yahoo.com" and xpath='/html/head'


    Jonathan LeBlanc
    Twitter: @jcleblanc
    0
  • QUOTE (Jonathan LeBlanc @ Jan 12 2011, 05:01 PM) <{POST_SNAPBACK}>
    Yep, by default a scrape through the HTML table returns the /html/body xpath content. You can return the <head> by modifying that xpath variable like so:

    CODE
    select * from html where url="http://www.yahoo.com" and xpath='/html/head'


    Jonathan LeBlanc
    Twitter: @jcleblanc


    Thanks! That helps a lot.

    Lester
    0

Recent Posts

in YQL