Issue
I am trying to get the data returned but instead My code:
def parse(self, response, **kwargs):
Name = response.xpath( "//h1//text()" ).get(),
But data return of Name is:
('Name product',)
How can I get only 'Example'?
Name product
Thanks
Solution
Change your code to the below (a.k.a remove the comma you put after ".get()".
def parse(self, response, **kwargs):
Name = response.xpath( "//h1//text()" ).get()
Note that the comma can be a useful feature to concisely return multiple values (if you didn't know already)
Answered By - Ricardo Udenze
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.