当前位置: 首页 > news >正文

简单的网站建设公司的模板下载中天建设南京公司

简单的网站建设公司的模板下载,中天建设南京公司,网站改版什么意思,销售客户管理软件哪个好近期因个人需要接触playwright#xff0c;由于playwright新接触#xff0c;想用jupyter进行API测试学习。刚开始使用sync_playwright#xff0c;在playwright的Conda运行环境中#xff0c;以console模式和单文件直接运行模式#xff0c;都能正常运行。但是进入jupyter中后…    近期因个人需要接触playwright由于playwright新接触想用jupyter进行API测试学习。刚开始使用sync_playwright在playwright的Conda运行环境中以console模式和单文件直接运行模式都能正常运行。但是进入jupyter中后sync_playwright就无法运行了。会出现如下提示 Error: It looks like you are using Playwright Sync API inside the asyncio loop. Please use the Async API instead. 在网上找到如何在 Jupyter 笔记本中使用 Playwright 库而不是使用常规 .py 脚本在 Windows 上 - python - SO中文参考 - www.soinside.com这篇文章才知道“Jupyter Notebook 使用 asyncio 事件循环因此您应该使用 async api”。 于是将sync_playwright改成 async_playwright。然后又面临上述文章中的同样问题。 Not Implemented error 按照上述文章所说更改jupyter核心运行库 1、导航到 Python 目录中的 Lib/site-packages/ipykernel/kernelapp.py 2、将该文件中的一行代码注释掉 if sys.platform.startswith(win) and sys.version_info (3, 8):import asynciotry:from asyncio import WindowsProactorEventLoopPolicy, WindowsSelectorEventLoopPolicyexcept ImportError:pass# not affectedelse:if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:# WindowsProactorEventLoopPolicy is not compatible with tornado 6# fallback to the pre-3.8 default of Selector# 注释掉此行asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())print(fdo not change to Selector Event Loop) #加入一行提示 则下述代码运行通过 from playwright.async_api import async_playwrightplaywright await async_playwright().start() browser await playwright.chromium.launch(headless False,)cawait browser.new_context(viewport{width:1024,height:768})page await c.new_page()await page.goto(http://image.baidu.com)await page.locator(#kw).fill(XXX...)await page.locator(#homeSearchForm span.s_btn_wr input).click()async with page.expect_popup() as page1_info:await page.locator(#imgid div ul li:nth-child(6)).click() page1 await page1_info.valueawait browser.close() await playwright.stop() 此问题产生的原因在这篇文章中有所描述Running Playwright in JupyterLab Notebook Problem - Not implemented Error - #2 by fomightez - JupyterLab - Jupyter Community Forum It appears that the problem is specific to Windows Platform and as identified in the original question as the use of SelectorEventLoopPolicy rather than ProactorEventloopPolicy in JupyterLabs is the source of the issue. Since SelectorEventLoopPolicy does not support Pipes the Not implemented error occurs when Playwright first tries to open a pipe.  ... #asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy()) Comment out that line, Not sure if this will have any adverse effects on other operations, but it does cause the original code to execute in JupyterLab. 似乎这个问题是特定于Windows平台的并且在原始问题中确定为在JupyterLabs中使用SelectorEventLoopPolicy而不是ProactorEventloopPolicy是问题的根源。 由于SelectorEventLoopPolicy不支持管道当playwright第一次尝试打开管道时会出现not implemented错误。 #asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy()) 注释掉这行代码, 不确定这是否会对其他操作产生任何不利影响但它确实会导致原始代码在JupyterLab中执行。 目前microsoft在github playwright的bug回复里这个问题并没有得到解决。所以这只能是一时之选。
http://www.hkea.cn/news/14504320/

相关文章:

  • 哈尔滨制作网站企业微信小程序后台管理系统
  • 桂林小学网站建设广州建设网站 公司
  • 巴中建设银行官方网站做网站公司 郑州
  • 国内有做网游评测的网站么网络规划与设计试题
  • 延吉制作网站公司网站建设会计分录
  • 文章标题-栏目名称-网站名 dede网站建设又叫什么
  • 做网站销售西安网站seo哪家公司好
  • 昭通市住房和城乡建设局网站金桥网站建设
  • 外国好的设计网站大全百度搜不到的网站
  • 做法城乡建设部网站推广神器
  • 电影片头在线制作网站手机排行榜zol
  • 厦门市建设工程安全质量协会网站高德地图能不能看国外
  • 网站域名地址是什么公司网页设计作品
  • 无锡网站建设价格立水桥网站建设
  • 做网站一个月赚多少钱wordpress rss 添加
  • 江西省注册和城乡建设厅网站珠海手机网站
  • 聊城做网站推广公司linux网站环境
  • 网站内的新闻怎样做链接开发微信公众
  • 湖南企业网站制作公司亳州网站建设费用
  • 宝塔建站网址北京seo关键词优化外包
  • 呼和浩特企业网站建设企业展厅设计公司豆河镇展厅设计公司笔中展览
  • 网站空间买什么的好在服务器网站上做跳转页面跳转页面
  • 网站开发赚钱吗 知乎wordpress pitch
  • 网站360优化备案的网站 能拿来做仿站吗
  • 沭阳做网站好的职业培训机构资质
  • 温州网站建设wzwmwl网站欣赏与创建网页
  • 网站开发的话术有没有免费的商城小程序
  • 山西网站建设找哪家wordpress会自动更新
  • 什么是网站开发公司怎样做网站搜索推广电话成都
  • 深圳企业建站设计公司微信小程序开发流程图