File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# 58
2+ ###tc_urlLists 模块:
23
3- 1 . channel_extact.py
4+ - ` get_channel_urls(url): `
45
5- **get_channel_urls** 获取所有的商品种类url,存在 *channel_list* 中
6- 2 . page_parsing.py
6+ ** url** :起始url
77
8- **get_links_from** 利用get_channel_urls返回的种类url获取每一种商品具体的每一个商品的url
9-
10- **get_item_info** 利用get_links_from的每一个商品的url获取每一个商品的大致信息(标题,价格,地区),返回一个由title,price,area组成的字典。
11- 3 . main.py
8+ 通过起始url获取所有的二级商品链接,存放在channel_list中 以便后续使用
129
13- 开启多进程,调用 * get_links_from* 和 * channel_list* 来抓去所有商品的信息
14- 4 . count.py
10+ ###tc_itemInfo 模块:
1511
16- 监测数据库中有多少条数据,每2秒打印一次
12+ - ` get_links_from(channel, pages, who_sells=0): `
13+
14+ ** channel** :58同城下的二级菜单的类别,** pages** :页数
15+
16+ 获取所有的商品种类url,存在 * channel_list* 中
17+
18+ - ` get_item_info(url): `
19+
20+ ** url** :58同城商品的链接
21+
22+ 方法返回商品的title、用户 、价格 、地区,并可以存放在数据库中(mongoDB)
23+
24+ ###main 和 count 模块:
25+
26+ ** get_all_links_from** :开启多进程,调用* tc_urlLists* 的channel_list 和 * tc_itemInfo* 的get_links_from获取全部url的全部详细信息
27+
28+ count.py用来监测数据库中有多少条数据,每2秒打印一次
Original file line number Diff line number Diff line change 11# coding:utf-8
22from multiprocessing import Pool
33from tc_urlLists import channel_list
4- from page_parsing import get_links_from
4+ from tc_itemInfo import get_links_from
55
66def get_all_links_from (channel ):
77 for num in range (1 ,101 ):
Original file line number Diff line number Diff line change 11# github
2- ###githubFollowXXList 模块:
2+ ###github_followXXList 模块:
33
44 - ` count(Tag): `
55
2727 方法返回当前page的following或者followers的列表,结合* get_follow_counts_pages* 结合可以获取所有page的following或者followers的列表
2828
2929
30- ###githubUserInfo 模块:
30+ ###github_userInfo 模块:
3131
3232 - ` get_user_info(url,person): `
3333
You can’t perform that action at this time.
0 commit comments