6

I'm trying to import the content of a website with thousands of posts using Feeds and its related tools.
I will import the content by accessing a page that contains all the links.

I've tried importing the content using <h2>http://premiumtemplate.org/kaboodle-premium-business-wordpress-theme.html</h2> as URL.

Below is the function I use:

Context: /
URL: //h:h2
title: //h:title
body: //*[@class="entry"]

I don't know what happens. It doesn't import anything, and I get the message "There is no new content."

3
  • Off topic, but are you sure that you are allowed to do what you are trying? I'm not sure if that website is interested in you copying their content. If they would be, they would probably have an RSS feed I guess
    – Berdir
    Commented Apr 30, 2011 at 13:10
  • no, im not interested to that website. this is just as an experiment. I sure what Im doing have some fault. but after correction, it generate blank nodes
    – ngamin
    Commented Apr 30, 2011 at 15:56
  • On a tangent, how about using a CSV to add new nodes, I have had more success using a CSV parser.
    – pal4life
    Commented Jun 11, 2015 at 3:43

2 Answers 2

7

Feeds is a very powerful module, and it is much more than a basic RSS aggregator. Many people are beginning to leverage Feeds as a migration tool, and Feeds XPath Parser is emerging as a popular way to import static HTML documents. I set up a quick parser to import this page, so hopefully the example will assist you with what you are trying to do.

First, it is important to enable the debugging options when using Feeds XPath Parser. This will show you what text was matched by your various queries.

debug options

Second, the image below shows the Context and XPath queries I used to import this page. The result is that it pulls the HTML title tag along with the content under an element containing the "question-page" class.

settings

If you are looking to pull the header elements, I think you will have to explicitly use "h1", "h2", etc. in your XPath query, but I am not sure about this. The downside of this approach is that you will have to have a source node for every page you are importing, or you will have to find a way to batch submit the import form either programmatically or through some automated tool such as Selenium, JMeter, Firefox Macro, etc.

1
  • Just to follow up, it looks like there is a way in feeds to be able to import source nodes. You would have to build a list of pages you would want to import, Feeds would create the source nodes which would point to the individual web pages, then running cron would import all of the individual web pages. Commented Jul 30, 2011 at 18:02
0

It's hard to give a good answer with the limited info you provided.

Usually Feeds is used to import from an feed (RSS) and not a stand alone page. Most likely you have setup feeds in a way that it expects to find a feed and not a plain HTML page.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.