💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# requests库 1. 相关链接 >http://docs.python-requests.org/zh_CN/latest/user/quickstart.html 2. pip安装 >pip install requests 3. wheel安装(需要先安装wheel库)pip install wheel >https://pypi.org/project/requests/#downloads >pip install requests-2.20.1-py2.py3-none-any.whl 4. 源码安装 ``` git clone https://github.com/requests/requests.git cd requests python setup.py install ``` 5. 验证安装 >import requests # selenium 1. 相关链接 >https://selenium-python-zh.readthedocs.io/en/latest/installation.html 2. pip安装 >pip install selenium 3. wheel安装(需要先安装wheel库)pip install wheel >https://pypi.org/project/selenium/ >pip install selenium-3.141.0-py2.py3-none-any.whl 4. 源码安装 5. 验证安装 >import selenium # ChromeDriver 1. 相关链接 >http://npm.taobao.org/mirrors/chromedriver/ >http://chromedriver.storage.googleapis.com/index.html >https://www.cnblogs.com/technologylife/p/5829944.html 2. 下载 chromedriver.exe(`Chrome浏览器版本与chromedriver版本需要对应上`) 3. windows下直接把 chromedriver.exe文件拖到C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Scripts目录下 4. 验证 (新建text.py ) ``` from selenium import webdriver driver = webdriver.Chrome() ``` # GeckoDriver 1. 相关链接 >https://github.com/mozilla/geckodriver/releases 2. 下载 geckodriver.exe (`firefox与geckodriver对应表,在网上找了好像没有很明确对应关系`) 3. windows下直接把 geckodriver.exe文件拖到C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Scripts目录下 4. 验证 (新建text.py ) ``` from selenium import webdriver browser = webdriver.Firefox() ``` # PhantomJS 1. 相关链接 >http://phantomjs.org/download 2. 下载 phantomjs.exe 3. windows下直接把 phantomjs.exe文件拖到C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Scripts目录下 - linux移动到/usr/bin目录 `sudo mv phantomjs /usr/bin` 4. 验证 (新建text.py ) ``` from selenium import webdriver browser = webdriver.PhantomJS() browser.get('http://www.baidu.com') print(browser.current_url) ```