Skip to content

Commit 39d7d2c

Browse files
committed
update the 58
1 parent 0eb9f7c commit 39d7d2c

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎58tongcheng/main.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ def get_all_links_from(channel):
88
get_links_from(channel,num)
99

1010
if __name__ == '__main__':
11-
# 创建进程池
1211
pool = Pool()
1312
pool.map(get_all_links_from,channel_list.split())

‎58tongcheng/page_parsing.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ def get_links_from(channel, pages, who_sells=0):
2222
# print link.get('href') # http://zhuanzhuan.58.com/detail/774777200171630596z.shtml?fullCate=5%2C36&fullLocal=1&from=pc
2323
# print item_link # http://zhuanzhuan.58.com/detail/774777200171630596z.shtml
2424
url_list.insert_one({'url': item_link, 'title': item_title})
25+
print item_link,item_title
26+
if item_link != 'http://jump.zhineng.58.com/jump':
27+
get_item_info(item_link)
2528
else:
2629
pass
2730

@@ -35,7 +38,6 @@ def get_item_info(url):
3538
else:
3639
title = soup.title.text
3740
price = soup.select('span.price_now i')[0].text
38-
# date = soup.select('.time')[0].text
3941
area = soup.select('.palce_li span i')[0].text # if soup.find_all('span', 'c_25d') else None
40-
# item_info.insert_one({'title': title, 'price': price, 'area': area, 'url': url})
41-
print {'title': title, 'price': price, 'area': area, 'url': url}
42+
item_info.insert_one({'title': title, 'price': price, 'area': area, 'url': url})
43+
print {'title': title, 'price': price, 'area': area}

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# pythonSpider
2-
some python spiders
2+
some python spiders with BeautifulSoup

0 commit comments

Comments
 (0)