資源簡介
美科新聞抓取程序源碼源代碼,2017年武漢美斯坦福寒假作業(yè)《美科新聞抓取程序》源代碼。
此實例是基于python 2.7開發(fā)的django項目,實現(xiàn)了登錄、注冊、采集新浪新聞 并保存到數(shù)據(jù)等功能
【調(diào)試說明】
1. 新建mysql數(shù)據(jù)庫meike
2. pip2運行腳本 pip2 install django==1.8 -i https://pypi.tuna.tsinghua.edu.cn/simple
3. pip2 install bs4 -i https://pypi.tuna.tsinghua.edu.cn/simple
4. pip2 install C:\Users\Administrator\Downloads\mysqlclient-1.4.6-cp27-cp27m-win_amd64.whl
mysqlclient-1.4.6-cp27-cp27m-win_amd64.whl 從這里下載 http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
5. 執(zhí)行創(chuàng)建數(shù)據(jù)表操作 D:\ide\Python27\python.exe D:\StudyProjects\PythonProject\meikenews\src\manage.py migrate 即:python27 manage.py migrage
6. 在數(shù)據(jù)庫meike的 news_admin表中 手動新增一條數(shù)據(jù) username和password都是 haolizi
7. D:\ide\Python27\python.exe D:\StudyProjects\PythonProject\meikenews\src\manage.py runserver
8. 此時瀏覽器打開 http://localhost:8000/news/login/ 即可看到如下圖效果 ,輸入賬號密碼(都是haolizi) 即可登錄
代碼片段和文件信息
-----------?---------??----------?-----??----
?????目錄???????????0??2020-02-18?23:11??old\
?????文件?????1457127??2020-02-18?18:53??old\舊版(已不能用)_美科新聞抓取程序源碼.zip
?????文件??????????82??2020-02-18?23:12??使用說明.txt
?????文件?????3473202??2020-02-18?23:10??meikenews.zip
評論
共有 條評論