Skip to content
This repository has been archived by the owner on Dec 3, 2022. It is now read-only.

[이슈] 좌표탐색을 누르면 cmd에 filenotfounderror: [error 2] no such file or directory #39

Closed
binchoo opened this issue Aug 7, 2021 · 13 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation 해결: 수정 이슈를 인지하여 코드를 수정하였다

Comments

@binchoo
Copy link
Owner

binchoo commented Aug 7, 2021

재현 절차

'브라우저로 탐지' 버튼을 클릭

이슈 내용

좌표탐색을 누르면 cmd에 filenotfounderror: [error 2] no such file or directory 에러 발생

기대 결과

브라우저 정상 실행

참조

selenium-wire가 인증서를 찾지 못하는 문제로 보임.
동일 이슈: wkeeling/selenium-wire#310

@binchoo binchoo added bug Something isn't working 수정없음: 재현불가능 제시한 이슈 내용을 확인할 수 없다 labels Aug 7, 2021
@binchoo binchoo self-assigned this Aug 7, 2021
@binchoo
Copy link
Owner Author

binchoo commented Aug 7, 2021

@Cjwuc 관련 에러 풀 텍스트로 볼 수 있을까요? 이 이슈에서 관련하여 얘기를 이어나가도록 합시다.

@binchoo
Copy link
Owner Author

binchoo commented Aug 7, 2021

> Exception in thread Thread-1:
> Traceback (most recent call last):
> File "threading.py", line 932, in _bootstrap_inner
> File "threading.py", line 870, in run
> File "qtmain.py", line 110, in
> capture_start = lambda: region_capture.start()
> File "service\lifecycle.py", line 27, in start
> self._handle_error(e)
> File "service\lifecycle.py", line 44, in _handle_error
> self.on_error_listener(self, error)
> File "qtmain.py", line 79, in error_handler
> raise error
> File "service\lifecycle.py", line 25, in start
> self._start()
> File "service\region.py", line 16, in _start
> self.open()
> File "service\selenium.py", line 13, in open
> self.driver = self.Driver(self.BinaryManager().install())
> File "seleniumwire\webdriver.py", line 99, in **init**
> File "seleniumwire\backend.py", line 24, in create
> File "seleniumwire\server.py", line 28, in **init**
> File "seleniumwire\utils.py", line 98, in extract_cert_and_key
> File "pkgutil.py", line 637, in get_data
> File "PyInstaller\loader\pyimod03_importers.py", line 371, in get_data
> FileNotFoundError: [Errno 2] No such file or directory:

@Cjwuc
Copy link

Cjwuc commented Aug 7, 2021

계정 로그인 까지는 되는데 웹브라우저 탐색이 안되네요 ㅠㅠ
개발자님 죄송합니더 ㅠㅠ

@binchoo
Copy link
Owner Author

binchoo commented Aug 7, 2021

@Cjwuc
C:\Users\본인 계정\AppData\Roaming 폴더에

ca.crt.txt
ca.key.txt

위 파일들의 확장자 .txt를 지우고서 넣어보세요.
(텍스트 파일이 아니면 업로드가 안 돼서;)

@Cjwuc
Copy link

Cjwuc commented Aug 7, 2021

관리자님ㅠㅠ 같은 에러가 지속 됩니다 죄송합니다 번거롭게 해드려서ㅠㅠ

@binchoo
Copy link
Owner Author

binchoo commented Aug 7, 2021

@Cjwuc 저도 문제 재현 확인하였습니다. 수정 후 코멘트 드리겠습니다! 이슈 등록 감사합니다.

@binchoo binchoo removed the 수정없음: 재현불가능 제시한 이슈 내용을 확인할 수 없다 label Aug 7, 2021
@Cjwuc
Copy link

Cjwuc commented Aug 7, 2021

개발자님 항상 고생하십니다!!!

@binchoo binchoo added the 진행중 이슈를 인지하여 코드 개선중 label Aug 7, 2021
@binchoo
Copy link
Owner Author

binchoo commented Aug 7, 2021

원인

seleniumwire 패키지가 소스코드 이외의 리소스 파일을 지니기 때문에 생기는 골 때리는 문제.

해결 방안

  1. .spec 파일을 생성하고 아래와 같이 코드를 추가한다. 문제되는 seleniumwire 패키지의 리소스를 얻어온 모습.

    from os.path import join, dirname, abspath, split
    from os import sep
    import glob
    import seleniumwire
    pkg_dir = split(seleniumwire.__file__)[0]
    pkg_data = []
    pkg_data.extend((file, dirname(file).split("site-packages")[1]) for file in glob.iglob(join(pkg_dir,"**{}*".format(sep)), recursive=True))

  2. 리소스 목록을 datas에 전달한다.

  3. .py 파일이 아닌 .spec 파일로 실행 파일을 빌드하자.
    pyinstaller --onefile dist\window-build.spec

참조

https://stackoverflow.com/questions/46474588/pyinstaller-how-to-include-data-files-from-an-external-package-that-was-install
https://pyinstaller.readthedocs.io/en/stable/spec-files.html

@binchoo binchoo added the documentation Improvements or additions to documentation label Aug 7, 2021
@binchoo
Copy link
Owner Author

binchoo commented Aug 7, 2021

@Cjwuc

  • 동일 이슈가 재현되는 환경에서
  • 새로운 버전의 실행 파일로 문제없이 매크로가 잘 수행되는 것을 확인하였습니다.

새로운 배포 버전은
https://github.com/binchoo/selenium-kakao-vaccine-reservation/releases/tag/1.1
에서 확인 가능합니다.

메이저 이슈 발견해 주셔서 감사합니다.

@binchoo binchoo closed this as completed Aug 7, 2021
@binchoo binchoo added 해결: 수정 이슈를 인지하여 코드를 수정하였다 and removed 진행중 이슈를 인지하여 코드 개선중 labels Aug 8, 2021
@Cjwuc
Copy link

Cjwuc commented Aug 8, 2021 via email

@binchoo
Copy link
Owner Author

binchoo commented Aug 8, 2021

@Cjwuc 호출하는 api는 맵에서 쓰는 api이기 때문에
가능성이 크지 않다고 봅니다. 더 공격적으로 값을 책정해 보셔요.

@Cjwuc
Copy link

Cjwuc commented Aug 8, 2021 via email

@binchoo
Copy link
Owner Author

binchoo commented Aug 8, 2021

@Cjwuc 앱 개선에 큰 도움 주셔서 감사합니다. 🙇‍♂️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Improvements or additions to documentation 해결: 수정 이슈를 인지하여 코드를 수정하였다
Projects
None yet
Development

No branches or pull requests

2 participants