Hi all,
I'm trying to extract data from a bulletin board website from specific board. Each board has different threads and each thread has some posts.

Now I'm looking for the title of each thread.

In the parse function, if I use
response.xpath('//*[starts-with(@class, "row")]')

I can obtain 28 different object like this "<Selector xpath='//*[starts-with(@class, "row")]' data=u'<li class="row bg1 announce">\n\t\t\t<dl cla'>" and it is ok, since I have 28 threads.

but if I'm trying to use xpath in one specific selector, in order to extract info, I get info to all 28 elements.

My code looks like this one:

for sel in response.xpath('//*[starts-with(@class, "row")]'):
    print "SEL: ", sel
    starter = sel.xpath('//*[starts-with(@title, "No message to read")]')
    print "STARTER: ", starter

the first print of starter showed 28 element and not just one.
The previous for cycle prints correctly each of the 28 element for SEL but for STARTER I obtain always the same output.

In other words, for each element of the 28 returned by response.xpath('//*[starts-with(@class, "row")]')
I would like to execute another xpath in order to extract other info.

Am sure that I'm missing something on how xpath works.
Sorry about that, I'm quite new on scrapy and xpath.

Thanks in advance,
    Massimo





--
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to