liuyuqi-dellpc 11 months ago
parent
commit
79df43ef42
4 changed files with 64 additions and 0 deletions
  1. 5 0
      crawl_modian/__init__.py
  2. 27 0
      crawl_modian/api.py
  3. 20 0
      crawl_modian/modian.py
  4. 12 0
      main.py

+ 5 - 0
crawl_modian/__init__.py

@@ -0,0 +1,5 @@
+
+
+
+def main():
+    pass

+ 27 - 0
crawl_modian/api.py

@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/05/17 21:17:34
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   
+'''
+
+host="https://www.modian.com"
+
+project_info_url = host + "https://zhongchou.modian.com/item"
+
+headers={ "Host": "zhongchou.modian.com",
+         "Connection": "keep-alive",
+         "Cache-Control": "max-age=0",
+         "Upgrade-Insecure-Requests": "1",
+            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \
+            (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36",
+}
+
+
+
+
+
+
+

+ 20 - 0
crawl_modian/modian.py

@@ -0,0 +1,20 @@
+import requests
+from crawl_modian import api
+
+class Modian(object):
+    ''''''
+    def __init__(self):
+        self.sess= requests.Session()
+        self.sess.headers.update(api.headers)
+        
+    def run(self):
+        pass
+
+    def get_project_info(self, project_id):
+        '''get project info'''
+        self.sess.get(api.project_info_url+"/{}.html".format(project_id)
+        , headers=api.headers)
+
+    def get_project_rank(self, project_id):
+        '''get project rank'''
+        pass

+ 12 - 0
main.py

@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8 -*-
+'''
+@Contact :   liuyuqi.gov@msn.cn
+@Time    :   2023/05/17 21:14:01
+@License :   Copyright © 2017-2022 liuyuqi. All Rights Reserved.
+@Desc    :   enter point
+'''
+from crawl_modian import main
+
+if __name__=='__main__':
+    main()