When using xml, its not a problem that parser loops trough xml and created 20 nodes if there is 20 child nodes in xml. But when doing the same with HTML then somehow this module is trying to import it all in same node (according to debugger). For example when trying to loop trough View rows in http://www.travelnut.me/ i have made a good xPath queris, according to Firepath. All that i want is
selected:

context: //div[@class='view-content']
title: div[*]/div[1]/div/h1
body: div[*]/div[1]/div/div[1]/div[2]

but module attempts to put all data into one node as debugger says. So i would like to know how to make it put data into different nodes as it usually does when using XML?

CommentFileSizeAuthor
#3 Clipboard01.jpg143.59 KBMarko B
#3 Clipboard02.jpg240.89 KBMarko B

Comments

twistor’s picture

Assigned: Unassigned » mitchell
Status: Active » Fixed

I'd do something like this:

context: //div[starts-with(@class, "views-row")]
title: div/div/h1/a
body: .//div[@class='field field-body']/p (notice the dot in front)

Hope this helps!

lagerassassin’s picture

total longshot and to be honest I don't expect anyone to help as I know I should keep going til I can do it myself but I've been on this for 3 days now and at the end of my tether lol

Im trying to pull data from http://www.bet365.com/extra/Streaming/

I need the match listings for a betting site im starting

I don't know whether I need the parser to be xml or html, guessing the latter but not 100% sure

can anyone help me with the context, title and body strings at all please? really i just need a node per date and all matches of that day listed in the body

you would save me sleepless nights if someone would be so kind, many thanks!

Marko B’s picture

StatusFileSize
new240.89 KB
new143.59 KB

Hey Twistor, thanx on helping, it got a bit better, now there is 10 of xpathparser:0: and xpathparser:1 valuse with corresponding html/text but still i get only one node created?

I tried several variants, also tried to be very specific like

context:div[@id='main']//div[starts-with(@class, "views-row")]
title:.//div/div/h1/a
body:.//div[@class='field field-body']/p

tried it without dots also, tried it all with FIREPATH and paths look fine. Also i tried to get data with
text() or node() function like //div/div/h1/a/text() but seems like parser ignores them and still loads it like it is //div/div/h1/a

I'll attach errors i get on top and also debug info. So you can see what i am talking about, seems fine but still only one node is created?!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Marko B’s picture

Not fixed, i'll try all of this on blank drupal and report again the status as i couldnt get this module to do what its suppose to do and not sure is it my fault or module isnt working good :-(

jacobpov’s picture

Same problem here , I have a page with around 10 pictures what it does it picks the first titile and uploads those 10 pictures into 1 node ... Hmm how can I make 1 picture + 1 title = 1 node?

FOR IMAGE:
.//*[@id='content']/div/p/img/@src

FOR TITLE:
.//*[@id='content']/div/h2/a/text()

jacobpov’s picture

Version: 6.x-1.9 » 7.x-1.x-dev
Assigned: mitchell » jacobpov
Category: feature » support
twistor’s picture

Assigned: jacobpov » Unassigned

@jacobpov,

You'll have better luck opening a new issue than commenting on an old closed one. Also, your XML structure will be needed.

@deepM, feel free to re-open the issue if you're still having problems.

blogook’s picture

I have the same question.