精华内容
下载资源
问答
  • 在学习selenium自动化测试中,遇到文件上传,书的作者轻轻跳过,回避了实际...安装pypiwin32库: pip install pypiwin32参考https://www.cnblogs.com/linuxchao/p/linuxchao-selenium-upload_file.html===========...

    在学习selenium自动化测试中,遇到文件上传,书的作者轻轻跳过,回避了实际工作要求。

    本着从实际出发的想法,在网上查了些资料,最终使用win32库完成文件上传。

    安装pypiwin32库: pip install pypiwin32

    参考https://www.cnblogs.com/linuxchao/p/linuxchao-selenium-upload_file.html

    ===============================================================

    回归正题,下面的内容是实操代码,希望注释能把事情描述的更清楚些。

    import win32con

    import win32gui

    from time import sleep

    from selenium.webdriver.common.action_chains import ActionChains

    from selenium import webdriver

    def uploadFile(browser:str,file:str):

    # 浏览器打开的窗口 标题名称有区别

    browser_type = {

    'firefox':'文件上传',

    'chrome':'打开',

    'ie':'选择要加载的文件'

    }

    sleep(2)

    # 使用工具WinSpy,定位“打开”窗口,class是 #32770

    dialog = win32gui.FindWindow('#32770',browser_type[browser])

    # 需要一级一级找子窗口edit;;;在工具WinSpy右侧可以看到“打开”窗口的结构:#32770 “打开”---ComboBoxEx32---ComboBox---Edit

    ComboBoxEx32 = win32gui.FindWindowEx(dialog,0,"ComboBoxEx32",None)

    ComboBox = win32gui.FindWindowEx(ComboBoxEx32,0,"ComboBox",None)

    edit = win32gui.FindWindowEx(ComboBox,0,"Edit",None)

    button = win32gui.FindWindowEx(dialog,0,"Button",None)

    win32gui.SendMessage(edit,win32con.WM_SETTEXT,None,file)

    win32gui.SendMessage(dialog,win32con.WM_COMMAND,1,button)

    if __name__ == '__main__':

    driver = webdriver.Chrome()

    driver.get(r'C:\Users\Administrator\PycharmProjects\webAutoTest\upload_file.html')

    element = driver.find_element_by_xpath('//*[@id="upload_file"]')

    action = ActionChains(driver)

    action.move_to_element(element).click().perform()

    action.release()

    sleep(3)

    uploadFile('chrome',r'C:\driver\chromedriver 64b.exe')

    sleep(3)

    driver.quit()

    展开全文
  • pypiwin32安装

    千次阅读 2018-12-22 20:11:50
    python -m pip install pypiwin32

    python -m pip install pypiwin32

    展开全文
  • <p>pypi.org has Feb 26, 2018 as latest for pypiwin32. pypi.org has Jun 13, 2020 as latest for pywin32. </li><li> <p>Looks like circa 2016 pypiwin32 was an offered repackaging of pywin32 to use wheels....
  • Windows安装pypiwin32

    千次阅读 2019-11-29 12:01:03
    使用python -m pip install pypiwin32,这个...python -m pip install pypiwin32 出现如下错误提示 File "C:\Users\zhangshengfan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\urlli...

    使用python -m pip install pypiwin32,这个模块就包含win32com

    python -m pip install pypiwin32

    出现如下错误提示

     File "C:\Users\zhangshengfan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\urllib3\respons
    e.py", line 307, in _error_catcher
        raise ReadTimeoutError(self._pool, None, 'Read timed out.')
    pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read
     timed out.
    You are using pip version 9.0.3, however version 19.3.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.
    

    按照提示upgrading

    python -m pip install --upgrade pip

    再次安装pypiwin32

    展开全文
  • Could not install pypiwin32

    2020-12-08 21:27:54
    I could install pypiwin32, I tried sudo pip3 install pypiwin32 but it shows this error: <p>Collecting pywin32 Could not find a version that satisfies the requirement pywin32 (from versions: ) No ...
  • in my project (which requires <code>fmpy</code> in its setuptools config), setuptools fails because it cannot find the dependency <code>pypiwin32</code> (there is only <code>pywin32</code> installed)....
  • Add recipe for pypiwin32

    2020-12-25 19:59:14
    <div><p><code>pypiwin32</code> is needed for some windows 32 extensions. The only packages available are wheels.</p><p>该提问来源于开源项目:conda-forge/staged-recipes</p></div>
  • pip install pypiwin32

    千次阅读 2018-04-29 15:55:24
    windows系统上出现这个问题的解决需要安装Py32Win模块,做法是:pip install pypiwin32

    windows系统上出现这个问题的解决需要安装Py32Win模块,

    做法是:

    pip install pypiwin32

    展开全文
  • t sure where to post this, since pypiwin32 doesn't seem to have its own home, but pypiwin32 introduced a dependency on pywin32 which either never has, or stopped providing python 3 wheels. This ...
  • 压缩包里包含python3.4.4 、pyinstaller3.2.1 、pypiwin32-219 、pywin32-221 ,还有一个XP下搭建打包环境的教程!!!
  • <div><p>pypiwin32 is quite a large dependency that isn't needed.</p><p>该提问来源于开源项目:frerich/clcache</p></div>
  • pypiwin32安装失败

    千次阅读 2019-01-08 13:46:29
    Scrapy 用的pypiwin32 环境 Python 3.6.3 :: Anaconda, Inc. pip 18.1 from c:\programdata\anaconda3\lib\site-packages\pip (python 3.6) windows 10 家庭版(1804) 首先查看错误是否一样 以及python版本是否...
  • 但是运行pip install pypiwin32时却提示两个库都已经安装过了 可是当再运行打包脚本时就是死活无法打包,就是提示缺少上面两个依赖库。 各种度娘发现都没有遇到类似奇葩情况的。 于是决定自行解决,首先根据错误...
  • 尝试使用pip安装Python...需求中存在pywin32包,因此我们得到一个错误:C:\Windows\system32>pip install pyadCollecting pyadUsing cached pyad-0.5.16.tar.gzRequirement already satisfied: setuptools in c:\...
  • <p>I have a problem when running cape2.sh base cape, during installing, it could not install pypiwin32/pywin32 and privoxy (on mongodb-server). So I need your support, I appreciate about your help! ...
  • 如下: Could not find a version that satisfies the requirement win32api (from versions: ) No matching distribution found for win32api改为pip install pypiwin32...
  • <div><p>New version of pypiwin32 (version 222) updated on 25-1-2018 cannot be installed. <p>Sometimes, package is being installed, however when trying to import "win32api" module, an exception...
  • 本人小白,还望各位...cmd中使用pip install pywin32 和pip install pypiwin32安装,均提示Successfully installed 但是在pycharm中import win32gui 和 import win32con 都报错,想知道有什么解决办法? 感谢! ...
  • pip install pypiwin32-219.zip Unpacking c:\users\abc\downloads\pypiwin32-219.zip Running setup.py (path:c:\users\abc\appdata\local\temp\pip-v9iuar-build\s etup.py) egg_info for package from file:///C...
  • <div><p>https://pypi.python.org/pypi/pypiwin32 points back to "http://sourceforge.net/projects/pypiwin32/" instead of "http://sourceforge.net/projects/pywin32/" <p>Reported by: ...
  • 互斥量: 采用互斥对象机制。...这里使用的是windows的互斥量,使用前需要安装pypiwin32模块 pip install pypiwin32 使用win32event.CreateMutex创建锁,在当前进程结束后自动释放锁,保证在同一时刻只有一个程序示
  • m installing pypiwin32-219.win32-py2.7.exe Thanks <img alt="python error" src="https://img-blog.csdnimg.cn/img_convert/ea266c8fe9e33484c98c8a2ac1294089.png" /></p>该提问来源于开源项目:sithis993...
  • <p><code>pypiwin32</code> did not have a version number. <h3>How was it fixed? <p>specified a version for pypiwin32 and moved it to install_requires. <p>I have tested this change on a windows machine....
  • <p>would it be possible, that you include the python3-pypiwin32 site package in the qgis standalone installer for the next PR 3.0.2? <p>thanks! <p>Related issue(s): #18899 (relates) Redmine related ...
  • pip install pypiwin32 pip install openpyxl 2、代码 import os from openpyxl import Workbook dirname = os.path.abspath('.') excel = win32.DispatchEx('Excel.Application') excel.Visible = False excel....
  • 报错信息 最近闲来无事,用python的tkinter库开发了一款带日程提醒的万年历桌面程序。在程序开发结束开始打包时,却发现一直报错 PyInstaller cannot check for ...pip install pypiwin32 但是运行pip inst...
  • 1.安装pypiwin32 https://pypi.org/project/pypiwin32/#files 下载安装包 在通过pip3 install pypiwin32-223-py3-none-any.whl 这个在windows平台下支持2 第一个是win32gui,这个模块内定义了一些有关图形操作的API...
  • <div><p>Fixes: ticket:2392 <p>This change is <a href="https://reviewable.io/reviews/tahoe-lafs/tahoe-lafs/685"><img src=...该提问来源于开源项目:tahoe-lafs/tahoe-lafs</p></div>
  • <div><p>On Windows there appears to be a breaking change with the release of version 222 of pypiwin32 <a href="https://pypi.python.org/pypi/pypiwin32">https://pypi.python.org/pypi/pypiwin32</a> ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 587
精华内容 234
关键字:

pypiwin32