Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def parse(self, response):
  2. # import sys
  3. global converter
  4. try:
  5. converter = html2text.HTML2Text()
  6. converter.ignore_links = True
  7. except:
  8. print "error"
  9. print response
  10. # for sel in response.xpath("//div/div/div/div/div/div[3]/div/div/div[1]/div[1]"):
  11. for sel in response.xpath("/html/body/div/div/div/div/div/div/div/div"):
  12. for tag in sel.xpath('div[1]/div'):
  13. print converter.handle(tag.extract())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement