dave
dave

Reputation: 23

Select attribute value by attribute name of element with xpath using scrapy

<meta name="GLOBEL:pageid" id="logsss_pageid" content="x-444511621">

Tried response.css('#logsss_pageid').extract() and got:

 ['<meta name="GLOBEL:pageid" id="logsss_pageid" content="x-444511621">']

all I need is the x-444511621

Upvotes: 1

Views: 106

Answers (1)

Computer&#39;s Guy
Computer&#39;s Guy

Reputation: 5353

Try with

response.css('#logsss_pageid').xpath('@content').get()

More info: selectors in scrapy using xpath

Upvotes: 1

Related Questions