1. 程式人生 > >python3爬蟲實戰筆記

python3爬蟲實戰筆記

介紹

Coveralls bitbucket branch

python使用版本:python3

(python3網路爬蟲開發實戰筆記)

pip換源

pip源:
豆瓣:http://pypi.douban.com/simple/
清華:https://pypi.tuna.tsinghua.edu.cn/simple

第一種:暫時性換源

有時候pip下載速度有點慢,可以換成國內源提升一下速度

pip install -i https://pypi.doubanio.com/simple/ 包名 

pip install -i https://pypi.doubanio.com/simple/ flask

第二種:永久換源

永久換源的方法如下:

linux下,修改 ~/.pip/pip.conf (沒有就建立一個), 修改 index-url,內容如下:

[global]

index-url = https://pypi.tuna.tsinghua.edu.cn/simple

windows下,直接在使用者目錄中建立一個pip目錄,如:C:\Users\miku\pip,新建檔案pip.ini,內容如下

[global]

index-url = https://pypi.tuna.tsinghua.edu.cn/simple

IDE工具

為了提升編碼速度,需要好的編譯器,推薦使用pycharm

以下是pycharm破解,使用2017版本就可以了

http://idea.lanyus.com/


-javaagent: E:\JetBrains\WebStorm 2018.1\lib\JetbrainsCrack-2.7-release-str


ThisCrackLicenseId-{
"licenseId":"ThisCrackLicenseId",
"licenseeName":"idea",
"assigneeName":"",
"assigneeEmail":"[email protected]",
"licenseRestriction":"For This Crack, Only Test! Please support genuine!!!"
, "checkConcurrentUse":false, "products":[ {"code":"II","paidUpTo":"2099-12-31"}, {"code":"DM","paidUpTo":"2099-12-31"}, {"code":"AC","paidUpTo":"2099-12-31"}, {"code":"RS0","paidUpTo":"2099-12-31"}, {"code":"WS","paidUpTo":"2099-12-31"}, {"code":"DPN","paidUpTo":"2099-12-31"}, {"code":"RC","paidUpTo":"2099-12-31"}, {"code":"PS","paidUpTo":"2099-12-31"}, {"code":"DC","paidUpTo":"2099-12-31"}, {"code":"RM","paidUpTo":"2099-12-31"}, {"code":"CL","paidUpTo":"2099-12-31"}, {"code":"PC","paidUpTo":"2099-12-31"} ], "hash":"2911276/0", "gracePeriodDays":7, "autoProlongated":false}

下載地址 密碼:v97f

Linux中切換python版本

首先先來看一下我們的預設Python版本

$ python --version
Python 2.7.6

然後修改一下別名

$ alias python='/usr/bin/python3'
$ python --version
Python 3.4.3  # 版本已經改變