首页 > 其他分享 >playwright and pyinstaller

playwright and pyinstaller

时间:2024-03-23 22:34:25浏览次数:13  
标签:playwright run -- py install pyinstaller

1.pycharm创建一个虚拟环境

playwright

启动chrome加载用户数据(非无痕模式)

playwright 启动无痕模式


#查看playwright内置浏览器安装路径
playwright install --dry-run


########### 打包exe 步骤###########
1.pycharm中创建虚拟环境
2.安装相关依赖
pip install playwright -i https://mirrors.aliyun.com/pypi/simple/
注意默认使用 python -m playwright install 安装chromium、frefox、webkit。
3. 设置环境变量,指定playwright浏览器安装目录
set PLAYWRIGHT_BROWSERS_PATH=绝对路径
set PLAYWRIGHT_BROWSERS_PATH=D:\code\yingdao\venv\Lib\site-packages\playwright\driver\pw-browsers
playwright install chromium
卸载安装的浏览器:playwright uninstall chromium
4. 安装打包工具
pip install pyinstaller

5.打包
pyinstaller -F main.py -i favicon.ico

#添加依赖
pyinstaller --add-data "dependency_folder;dependency_folder" your_script.py

pyinstaller --hidden-import your_module your_script.py

pyinstaller --add-data "utils;utils" run.py
pyinstaller --hidden-import utils run.py
-w 来让程序运行时不显示
pyinstaller --add-data "resources;resources" run.py

标签:playwright,run,--,py,install,pyinstaller
From: https://www.cnblogs.com/knighterrant/p/18091822

相关文章

  • webui自动化框架-playwright
    playwright中文文档Playwright为现代web应用提供了跨浏览器、快速且可靠的端到端的测试能力。|Playwright中文文档|Playwright中文网(bootcss.com)playwright安装pipinstallplaywrightplaywright-浏览器安装playwright的nohead模式需要在本地安装浏览器的内核pl......
  • 强大易用!新一代爬虫利器 Playwright 的介绍
    Playwright是微软在2020年初开源的新一代自动化测试工具,它的功能类似于Selenium、Pyppeteer等,都可以驱动浏览器进行各种自动化操作。它的功能也非常强大,对市面上的主流浏览器都提供了支持,API功能简洁又强大。虽然诞生比较晚,但是现在发展得非常火热。因为Playwright......
  • 在win10下用pyinstaller打包scrapy项目生成exe文件
    这个玩意的使用方法很简单,但是有很多坑,特别是项目稍微大一点,import引用的很多的时候,那就是打包要人命了,基本不会正常。注意有时候还需要执行pipinstall pywin32之后再进行打包。1、打包完之后,无法导入模块。譬如:你用 pyinstaller-Fentrypoint.py【只生成一个entrypoi......
  • PyInstaller:将你的Python代码打包成独立应用程序,让你的创意无限释放!
    https://www.bilibili.com/read/cv24488127/ 简介PyInstaller是一个用于将Python应用程序打包为独立可执行文件的工具。它可以将Python脚本转换为可以在目标机器上独立运行的可执行文件,无需事先安装Python解释器或其他依赖项。PyInstaller支持多个平台,包括Windows、Mac和Linux......
  • python+playwright 以非無痕模式打开chrome浏览器
    在使用python+playwright想从网页下载Excel数据,因为需要经过SSO,携带Tokey才可以访问数据,所以无痕模式下搞不好,使用非无痕模式打开浏览器,就可以获取cookie,成功达到效果。点击查看代码frommultiprocessing.sharedctypesimportValuefromplaywright.sync_apiimportsync_pla......
  • PyInstaller does not include a pre-compiled bootloader for your platform.
    用PyInstaller打包python程序时,收到下面错误:User140343INFO:BuildingPKGbecausePKG-00.tocisnonexistent140344INFO:BuildingPKG(CArchive)mainwindow.pkg215759INFO:BuildingPKG(CArchive)mainwindow.pkgcompletedsuccessfully.215891INFO:Bootloa......
  • PyInstaller does not include a pre-compiled bootloader for your platform.
    用PyInstaller打包python程序时,收到下面错误:User140343INFO:BuildingPKGbecausePKG-00.tocisnonexistent140344INFO:BuildingPKG(CArchive)mainwindow.pkg215759INFO:BuildingPKG(CArchive)mainwindow.pkgcompletedsuccessfully.215891INFO:Bootloa......
  • 【python】自动化工具Selenium与playwright去除webdriver检测
    对这个世界如果你有太多的抱怨跌倒了就不敢继续往前走为什么人要这么的脆弱堕落请你打开电视看看多少人为生命在努力勇敢的走下去我们是不是该知足珍惜一切就算没有拥有                     ......
  • Python学习+PySimpleGUI+Pyinstaller,制作Windows桌面小工具
    1开发环境Python+PyCharm2第三方库2.1PySimpleGUI是基于Python的图形界面开发工具pipinstall PySimpleGUIPySimpleGUI5.0版本后开始收费,好像注册个人用户是免费,嫌麻烦我直接用的之前的版本 pip installPySimpleGUI==4.60.5 2.2PyInstaller是一个在Windows、G......
  • 关于Pyinstaller在打包Streamlit程序时遇到的IndexError:tuple index out of range
    如题,在使用Pyinstaller库打包过程中,如果遇到IndexError:tupleindexoutofrange,不必惊慌,本质上是库函数在传参过程中出现异常下面是解决方案:找到..\envs\steamlit\lib\dis.py这个文件。如果你是用的虚拟环境,比如conda,那这个文件位于anaconda的安装目录"E:\SOFTWARE\ANAC......