# Hello Python **Repository Path**: lucups/hello-python ## Basic Information - **Project Name**: Hello Python - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-11 - **Last Updated**: 2021-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hello Python ### 技能树 - Git - Markdown - Python - HTML & CSS & JavaScript ### Selenium 环境配置 1. 安装 Python(默认选项即可); 2. 安装 Selenium: pip install selenium; 3. 安装 WebDriver: [WebDriver 下载](https://chromedriver.storage.googleapis.com/index.html) -> [设置环境变量](https://www.selenium.dev/documentation/getting_started/installing_browser_drivers/) ### 开发工具 - [Visual Studio Code](https://code.visualstudio.com/) ### Selenium 基本用法 ```python # 打开一个网页 import time from selenium.webdriver import Chrome driver = Chrome() driver.get("https://baidu.com") ``` ```python # 获取网页内元素的内容 hotsearch = driver.find_elements_by_tag_name("li") print(hotsearch) for child in hotsearch: print(child.text) ``` ```python # 向网页输入 kwInput = driver.find_element_by_id("kw") kwInput.send_keys("Hello Selenium") driver.find_element_by_id("su").click() ```