selenium学习笔记

目录

1. what is selenium: 

2. components of selenium

3. selenium WebDriver

4. element

5. locate element

6. beautiful soup


1. what is selenium: 

a set of tools and libraries that automate web browser actions

通过web-driver packages to control browser and emulate user oriented actions

2. components of selenium

4 components of selenium

1) selenium IDE: record and playback; used for prototype testing

2) selenium RC(remote control): a test tool that allows you to write automated web app ui test

3) selenium WebDriver

4) selenium Grid: used for parallel or distributive testing

3. selenium WebDriver

WebDriver API: drive the browser natively, as a user would either locally or on a remote machine using the selenium server

when executing a test script using WebDriver:

-> executer one selenium command 

-> generate http request and send to browser driver

-> driver receive http request through the http server

-> the server decides all the steps to perform instructions which are executed on the browser

-> execution status is sent back to the http server which is subsequently sent back to the automation script

4. element

elements: everything you see on a page is an element(field, link, text, image...)

dynamic elements: ID, name, class or css-attributes are not fixed, will change whoever page is reloaded

5. locate element

6. beautiful soup

pip install beautifulsoup4

page_source_overview = driver.get_source

from bs4 import BeautifulSoup

soup = BeautifulSoup(page_source_overview, 'lxml')

title_finder = soup.find_all('span', class_='title')

for title in title_finder:

print(title.string)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值