Issue
Given the following Xpath selector from a Youtube channel ,I need to extract its id
response.xpath('/html/body/meta[@itemprop="channelId"]/@content')
which results in:
<Selector xpath='/html/body/meta[@itemprop="channelId"]/@content' data='UCPeA5h9SwPCV2a0SPlXHgNA'>
how do i get the data in a string format using python
Solution
it's work for me
response.xpath('/html/body/meta[@itemprop="channelId"]/@content').get()
Answered By - r3a9670
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.