Giter Site home page Giter Site logo

cordcloud_checkin's Issues

Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="email"]"}

作者您好,我拉取了您修改后的代码,虽然执行 Action 中 test workflow 成功了

但是并没有成功签到成功,遇到了一些问题。Selenium自动化测试时,貌似Web页面没有加载完(当然也可能是cloudflare的人机验证),导致无法定位email元素,Login失败,后续代码失效。

我使用的登录网址URL是:https://www.cordcloud.biz/

我试着解决,但是并没有起效。

错误如下:

Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="email"]"}

完整报错如下:

Run export DISPLAY=:99
[1]+  1772 Running                 sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
google chrome version: 115.0.5790.110
major version is 115
{'timestamp': '2023-08-02T23:08:04.395Z', 'channels': {'Stable': {'channel': 'Stable', 'version': '115.0.5790.170', 'revision': '1148114', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win[32](https://github.com/Oraer/cordcloud_checkin/actions/runs/5751980749/job/15591918793#step:7:33)', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.170/win64/chromedriver-win64.zip'}]}}, 'Beta': {'channel': 'Beta', 'version': '116.0.5845.49', 'revision': '1160321', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win64/chromedriver-win64.zip'}]}}, 'Dev': {'channel': 'Dev', 'version': '117.0.5911.2', 'revision': '1175078', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win64/chromedriver-win64.zip'}]}}, 'Canary': {'channel': 'Canary', 'version': '117.0.5926.0', 'revision': '1178[34](https://github.com/Oraer/cordcloud_checkin/actions/runs/5751980749/job/15591918793#step:7:35)9', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5926.0/win64/chromedriver-win64.zip'}]}}}}
download chrome driver successfully.
unzip chromedriver to ./chromedriver/chromedriver-linux64/chromedriver
/home/runner/.local/share/undetected_chromedriver
Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="email"]"}
  (Session info: chrome=115.0.5790.0); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
#0 0x55de4450d613 <unknown>
#1 0x55de44239537 <unknown>
#2 0x55de44277f53 <unknown>
#3 0x55de44278041 <unknown>
#4 0x55de442b32a4 <unknown>
#5 0x55de44298a5d <unknown>
#6 0x55de442b0d09 <unknown>
#7 0x55de44298803 <unknown>
#8 0x55de4426c68b <unknown>
#9 0x55de4426d42e <unknown>
#10 0x55de444cec28 <unknown>
#11 0x55de444d2af7 <unknown>
#12 0x55de444dd01c <unknown>
#13 0x55de444d3723 <unknown>
#14 0x55de444a2457 <unknown>
#15 0x55de444f7628 <unknown>
#16 0x55de444f77b7 <unknown>
#17 0x55de44506483 <unknown>
#18 0x7f[36](https://github.com/Oraer/cordcloud_checkin/actions/runs/5751980749/job/15591918793#step:7:37)d1b5db[43](https://github.com/Oraer/cordcloud_checkin/actions/runs/5751980749/job/15591918793#step:7:44) <unknown>

Start checkin Failed

作者您好,我fork了您的项目,按照您推荐的方法在Actions中部署,但是我遇到了一些问题 Start checkin Failed,

您能告诉我我是哪一步出了问题吗?我将感激不尽!

当我在 workflow 中运行 test 时发生了如下报错 Start checkin Failed:

Permission denied: './chromedriver/chromedriver-linux64/chromedriver

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions.

完整报错如下:

Run export DISPLAY=:99
[1]+  1773 Running                 sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
Traceback (most recent call last):
google chrome version: 115.0.5790.102
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 206, in _start_process
    self.process = subprocess.Popen(
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/subprocess.py", line 971, in __init__
major version is 115
{'timestamp': '2023-08-01T18:09:01.353Z', 'channels': {'Stable': {'channel': 'Stable', 'version': '115.0.5790.102', 'revision': '1148114', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chromedriver-win64.zip'}]}}, 'Beta': {'channel': 'Beta', 'version': '116.0.5845.49', 'revision': '1160321', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win64/chromedriver-win64.zip'}]}}, 'Dev': {'channel': 'Dev', 'version': '117.0.5911.2', 'revision': '1175078', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5911.2/win64/chromedriver-win64.zip'}]}}, 'Canary': {'channel': 'Canary', 'version': '117.0.5923.0', 'revision': '1177453', 'downloads': {'chrome': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/linux64/chrome-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/mac-arm64/chrome-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/mac-x64/chrome-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/win32/chrome-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/win64/chrome-win64.zip'}], 'chromedriver': [{'platform': 'linux64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/linux64/chromedriver-linux64.zip'}, {'platform': 'mac-arm64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/mac-arm64/chromedriver-mac-arm64.zip'}, {'platform': 'mac-x64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/mac-x64/chromedriver-mac-x64.zip'}, {'platform': 'win32', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/win32/chromedriver-win32.zip'}, {'platform': 'win64', 'url': 'https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/117.0.5923.0/win64/chromedriver-win64.zip'}]}}}}
download chrome driver successfully.
unzip chromedriver to ./chromedriver-linux64/chromedriver
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno [13](https://github.com/Oraer/cordcloud_checkin/actions/runs/5734475090/job/15540714503#step:7:14)] Permission denied: './chromedriver/chromedriver-linux64/chromedriver'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/work/cordcloud_checkin/cordcloud_checkin/AutoCheckin.py", line 192, in <module>
    main()
  File "/home/runner/work/cordcloud_checkin/cordcloud_checkin/AutoCheckin.py", line [18](https://github.com/Oraer/cordcloud_checkin/actions/runs/5734475090/job/15540714503#step:7:19)8, in main
    start_checkin(username, password, url, chrome_path, chromedriver_path)
  File "/home/runner/work/cordcloud_checkin/cordcloud_checkin/AutoCheckin.py", line 1[19](https://github.com/Oraer/cordcloud_checkin/actions/runs/5734475090/job/15540714503#step:7:20), in start_checkin
    driver = uc.Chrome(options=options, driver_executable_path=chromedriver_path)
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 443, in __init__
    super(Chrome, self).__init__(
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 53, in __init__
    self.service.start()
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 105, in start
    self._start_process(self._path)
  File "/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 2[21](https://github.com/Oraer/cordcloud_checkin/actions/runs/5734475090/job/15540714503#step:7:22), in _start_process
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions.

Error: Process completed with exit code 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.