# web-scraping **Repository Path**: yunjiao-source/web-scraping ## Basic Information - **Project Name**: web-scraping - **Description**: 爬虫 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-02 - **Last Updated**: 2023-03-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # web-scraping 爬虫 #### 环境准备 创建Python虚拟环境 ``` conda create -n web-scraping ``` 在vscode中,使用这个环境,`Ctrl + Shift + P` 打开命令窗口,输入`Python:Select Interpreter`, 选择上一步创建的`venv`环境 安装依赖包 ``` pip install - r requirements.txt ``` #### 帮助 生产依赖列表文件 ``` pip freeze > requirements.txt ``` 游览器开发人员工具中获取元素 ``` $x('//*[@id="question-summary-75612519"]/div[2]') ``` scrapy创建项目 ``` scrapy startproject stack ``` #### FAQ vscode无法conda activate环境 ``` 管理员打开powershell, 输入conda init,然后关掉powershell界面 ```