def _parse_list_body(self, body): # print(body) doc = html.fromstring(body) items = utils.parse_list_items_1(doc) [self._add_article(item) for item in items] # print(pprint.pformat(items)) return items
def _parse_list_body(self, body): # print(body) # sys.exit(0) doc = html.fromstring(body) items = utils.parse_list_items_1(doc) [self._add_article(item) for item in items] # print(len(items)) return items
def _parse_list_body(self, body): doc = html.fromstring(body) first = utils.parse_list_first(doc) self._add_article(first) columns = utils.parse_list_items_1(doc) [self._add_article(column) for column in columns] columns.append(first) return columns
def _parse_list_body(self, body): doc = html.fromstring(body) first = utils.parse_list_first(doc) self._add_article(first) # print(first) # print(body) # sys.exit(0) doc = html.fromstring(body) items = utils.parse_list_items_1(doc) [self._add_article(item) for item in items] # print(pprint.pformat(items)) items.append(first) return items
def _parse_list_body(self, body): ''' <li> <p class="tit"><a href="http://news.stcn.com/2020/0228/15689665.shtml" target="_blank" title="养猪改变命运!1530亿身家的河南新首富,风口上的2600亿养猪巨头">养猪改变命运!1530亿身家的河南新首富,风口上的2600亿养猪巨头</a></p> <p class="exp"></p> <p class="sj">2020-02-28<span>10:11</span></p> </li> ''' # print(body) # sys.exit(0) doc = html.fromstring(body) items = utils.parse_list_items_1(doc) [self._add_article(item) for item in items] # print(len(items)) return items
def _parse_list_body(self, body): ''' <ul class="news_list"> <li> <p class="tit"><a href="http://news.stcn.com/2020/0225/15682787.shtml" target="_blank" title="新零售商家加快复工复产 菜鸟急调400辆车驰援商家发货">新零售商家加快复工复产 菜鸟急调400辆车驰援商家发货</a></p> <p class="exp"></p> <p class="sj">2020-02-25<span>20:32</span></p> </li> ''' # print(body) # sys.exit(0) doc = html.fromstring(body) items = utils.parse_list_items_1(doc) [self._add_article(item) for item in items] # print(len(items)) return items
def _parse_list_body(self, body): ''' <ul class="news_list"> <li> <p class="tit"><a href="http://news.stcn.com/2020/0224/15657601.shtml" target="_blank" title="高瓴资本宣布成立“高瓴创投” 首期规模100亿">高瓴资本宣布成立“高瓴创投” 首期规模100亿</a></p> <p class="exp">高瓴资本在其官方公众号发布“致创业者的一封信”,宣布成立专注于投资早期创业公司的高瓴创投,主要专注于生物医药及医疗器械、软件服务和原发科技创新、消费互联网及科技、新兴消费品牌及服务四大领域的风险投资。</p> <p class="sj">2020-02-24<span>12:00</span></p> </li> ''' # print(body) # with open("hello.html", "w") as f: # f.write(body) # sys.exit(0) doc = html.fromstring(body) items = utils.parse_list_items_1(doc) [self._add_article(item) for item in items] # print(len(items)) return items