CSS selector:
Excract_first If the array is empty throws an exception after this function is used, there is no exception, and if it is not fetched, it is empty.
Extract the title:
======================================================================
:: Is a CSS fixed usage to extract content
Response.css ('. Entry-header H1:: Text'). Extract () [0]
>>> Response.css ('P.entry-meta-hide-on-mobile::text'). Extract () [0]'\r\n\r\n 2017/02/18 · '>>> Response.css ('P.entry-meta-hide-on-mobile::text'). Extract () [0].strip ()'2017/02/18 ·'>>> Response.css ('P.entry-meta-hide-on-mobile::text'). Extract () [0].strip (). Replace ('·',' ')'2017/02/18'
>>> response.css ('. vote-post-up h10::text'). Extract () [' 2 ']
Response.css ('a[href= ' #article-comment "] span::text'). Extract () [0] ' 7 Reviews '
Full code
Python distributed crawler CSS Selector