I've created a feed attached to a story, and selected HTML, and specified my feed URL as http://www.theregister.co.uk/ and the context is: /html/body/div[2]/div[6] On clicking preview, I get the error message:

warning: Invalid argument supplied for foreach() in /public_html/sites/all/modules/feeds_xpathparser/FeedsXPathParserHTML.inc on line 54.

If I change the context from /html/body/div[2]/div[6] to /html/body/div[2], then I no longer get the warning message.

I'm getting the XPath using Firebug (useful!). I also get the message "Could not retrieve title from feed.", but I guess that's my incompetence at working out the correct XPath for the story titles.

Comments

twistor’s picture

I tried both queries on el reg and neither of them turned up anything. Try the XPath and XPather firefox extensions. They should be a big help. The no title issues is that you're not setting a title for the feed node itself. I've got it in the works to parse out the title for it when using only the HTML parser, but that'll be a few days.

iantresman’s picture

Here are the links to the Firefox add-ons, which look useful:

  • XPather "Feature rich XPath generator, editor, inspector and simple extraction tool"
  • XPath Checker "An interactive editor for XPath expressions"

And some extra ones:

  • FireXPath "a Firebug extension that adds a development tool to edit, inspect and generate XPath expressions."
  • Firefinder for Firebug "A Firebug add-on that finds HTML elements matching chosen CSS selector(s) or XPath expression"

If and when you start a Drupal documentation page for your Feeds XPath Parser, this kind of information can go there.

twistor’s picture

Status: Active » Postponed (maintainer needs more info)

The message "Could not retrieve title from feed" is actually because you didn't set the title of the feed node. I have to make that feed mandatory. Are you still having trouble?

twistor’s picture

Assigned: Unassigned » twistor
twistor’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
myregistration’s picture

Status: Closed (fixed) » Needs review

subscribe

twistor’s picture

@myregistration,

What version are you using? Example XML/HTML and XPath queries? I need the information necessary to reproduce your error.

twistor’s picture

Status: Needs review » Postponed (maintainer needs more info)
twistor’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)