惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
美团技术团队
V
Visual Studio Blog
F
Full Disclosure
腾讯CDC
H
Help Net Security
D
DataBreaches.Net
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 司徒正美
N
Netflix TechBlog - Medium
U
Unit 42
Vercel News
Vercel News
I
InfoQ
S
SegmentFault 最新的问题
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
有赞技术团队
有赞技术团队
博客园_首页
The GitHub Blog
The GitHub Blog
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
NISL@THU
NISL@THU
P
Privacy & Cybersecurity Law Blog
Recorded Future
Recorded Future
Y
Y Combinator Blog
S
Schneier on Security
P
Proofpoint News Feed
T
Tenable Blog
Cloudbric
Cloudbric
博客园 - 【当耐特】
The Register - Security
The Register - Security
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security
量子位
A
Arctic Wolf
N
News and Events Feed by Topic
H
Hacker News: Front Page
MongoDB | Blog
MongoDB | Blog
The Hacker News
The Hacker News
Webroot Blog
Webroot Blog

博客园 - 三叶草╮

DeepAgents 长期记忆相关组件详解 DeepAgents 长期记忆 笔记 Python 机器学习03 - 常见分类算法 Python 机器学习02 - 常见分类算法 Python uv 包管理 Python机器学习01 - Sklearn Python高级编程笔记 (线程/进程/协程) Python高级编程笔记 Python 基础笔记 Pandas 常用操作 (缺失值处理/排序/字符串处理/Index/Merge/合并) Python Pandas pipreqs:快速准确生成当前项目的requirements.txt,还有和freeze的对比 WPF 4款 UI 库 C# Selenium [转]在WPF中自定义控件 UserControl [转]WPF的依赖属性是怎么节约内存的 [转]WPF中的导航框架 [转]C#对Excel报表进行操作(读写和基本操作) C# 模拟http请求网页数据 [网页爬虫]
Python playwright 笔记
三叶草╮ · 2024-12-12 · via 博客园 - 三叶草╮

1.官网 https://playwright.nodejs.cn/docs/api/class-playwright

2.Playwright for Python:https://playwright.bootcss.com/python/docs/intro

3.入门笔记:https://www.byhy.net/

4.playwright使用教程python版本-页面监听器、状态检测、执行JS、网络Mock等使用API  https://www.bilibili.com/opus/860060080235610135

5.《最新出炉》系列小成篇 https://www.cnblogs.com/du-hong/category/2309756.html

from playwright.sync_api import sync_playwright

playwright = sync_playwright().start()
browser = playwright.chromium.launch(headless=False,
                                     executable_path=r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
                                     args=['--start-maximized'])
context = browser.new_context(no_viewport=True)
page = context.new_page()
page.goto("http://10.151.14.107:12345/")
page.locator(".my-project").click()

page.locator("#user").fill("admin")
page.locator('#pwd').fill("123456")
page.locator("#btnLogin").click()

page.locator('#txtName').fill('test')
page.locator('#btnSearch').click()
page.wait_for_timeout(1000)

print("Start get information...")

table = page.locator('//*[@id="divTable"]/table/tbody/tr').all()
for row in table:
    row_text = row.inner_text()
    row_list = row_text.split('\t')
    print(f"ID is {row_list[0]}  and Name is {row_list[1]}")

print("End get information... 88 ...")

browser.close()
playwright.stop()