Thanks for the reply. I found this doesn't work as expected either. Even 
without replace I can also get the selector with:  


response.xpath('@class="inline"')


Also there are actually 3 div blocks satisfying: "//div[@class='inline']"



On Sunday, March 6, 2016 at 1:03:51 AM UTC+1, Steven Almeroth wrote:
>
> Guo, it seems that the default selector (lxml) has trouble with a reeally 
> long line, 229310 chars.
>
> $ scrapy shell "http://chuansong.me/n/2584954";
> >>> r = response.replace(body=response.body.replace('>', '>\n'))
> >>> r.xpath('@class="inline"')
> [<Selector xpath='@class="inline"' data=u'0'>]
>
>
> On Saturday, March 5, 2016 at 11:36:55 AM UTC-7, Cheng Guo wrote:
>>
>> I used scrapy shell to load this webpage:
>>
>> ```
>>
>> scrapy shell "http://chuansong.me/n/2584954";
>> ```
>>
>> and want to find:
>>
>> ```
>>
>> response.xpath("//div[@class='inline']")
>> ```
>>
>> However, it returns []. If I use find in chrome inspect of this webpage, 
>> I could find there of "//div[@class='inline']". Is this a bug?
>>
>>

-- 
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