Issue
I want to extract HTML inside a dic
. For example in this piece of HTML:
<div id="main"><h1><xyz>Title<xyz></h1></div>
I want to extract div content: <h1><xyz>Title<xyz></h1>
as a string.
Is that possible with CSS o Xpath scrapy selectors?
Thanks :)
Solution
Solution with css selector is not possible, but pretty simple with xpath:
desired_str = selector.xpath("//div[@id='main']").extract()
Answered By - Fernando V
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.