Giter VIP home page Giter VIP logo

Comments (27)

Sherwin-Wang avatar Sherwin-Wang commented on July 2, 2024 1

膜拜大神。同样是64bit win10 + python3.74 64位,未安装anaconda,报同样的错误

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024 1

anaconda至于这个我不记得了,好像没有装,但不知道pycharm有没有带这个,明天白天再看一下,有情况再来反馈

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

系统是win10 64位

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

C:\Windows\system32>pip install urllib3
Collecting urllib3
Using cached urllib3-1.26.4-py2.py3-none-any.whl (153 kB)
Installing collected packages: urllib3
Successfully installed urllib3-1.26.4

C:\Windows\system32>pip install selenium
Collecting selenium
Using cached selenium-3.141.0-py2.py3-none-any.whl (904 kB)
Requirement already satisfied: urllib3 in c:\users\yang\appdata\local\programs\python\python39-32\lib\site-packages (from selenium) (1.26.4)
Installing collected packages: selenium
Successfully installed selenium-3.141.0

C:\Windows\system32>
C:\Windows\system32>C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\python.exe C:\Users\Yang\Desktop\JDBrandMember-main\main.py
日志已生成,查看./logs/ Some log data is being generated: ./log/ ...正在关闭,不要退出

C:\Windows\system32>

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

你是否安装过anaconda
请查看一下你的环境变量,是否存在两个python环境,如果有的话,请保留 anaconda那个环境

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

在控制台运行

ftype Python.File
看返回的是什么

膜拜大神。同样是64bit win10 + python3.74 64位,未安装anaconda,报同样的错误

from jdbrandmember.

Sherwin-Wang avatar Sherwin-Wang commented on July 2, 2024

ftype Python.File

Python.File="C:\WINDOWS\py.exe" "%L" %*

清楚为什么报错了吗?

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

ftype Python.File

Python.File="C:\WINDOWS\py.exe" "%L" %*

清楚为什么报错了吗?

😭不知道

from jdbrandmember.

Sherwin-Wang avatar Sherwin-Wang commented on July 2, 2024

ftype Python.File

Python.File="C:\WINDOWS\py.exe" "%L" %*
清楚为什么报错了吗?

😭不知道

网上有说是因为32位造成的这个错误OSError: [WinError 193] %1 不是有效的 Win32 应用程序

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

ftype Python.File

Python.File="C:\WINDOWS\py.exe" "%L" %*
清楚为什么报错了吗?

😭不知道

网上有说是因为32位造成的这个错误OSError: [WinError 193] %1 不是有效的 Win32 应用程序

不清楚,但 @lanyucomputer 已经用64 、32位测试过了都不行。我只记得我以前office的快捷方式也出现过%1的错误问题,是因为%1在windows中代表的是目标文件。以前装过pythonselenium包但没有卸载干净的可能会导致注册表出现问题。

但应该不是脚本的问题。。。。


参考OSError: [WinError 193] %1 is not a valid Win32 application

可能需要将lib/python3.8/subprocess.py Popen.__init__的 735 行的shell=False改成shell=True虽然这个方法很不好

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

额为何评论被标记为垃圾邮件

from jdbrandmember.

jiurou avatar jiurou commented on July 2, 2024

我也是这个问题,只能用打包版了,手动更新店铺信息

from jdbrandmember.

Sherwin-Wang avatar Sherwin-Wang commented on July 2, 2024

ftype Python.File

Python.File="C:\WINDOWS\py.exe" "%L" %*
清楚为什么报错了吗?

😭不知道

网上有说是因为32位造成的这个错误OSError: [WinError 193] %1 不是有效的 Win32 应用程序

不清楚,但 @lanyucomputer 已经用64 、32位测试过了都不行。我只记得我以前office的快捷方式也出现过%1的错误问题,是因为%1在windows中代表的是目标文件。以前装过pythonselenium包但没有卸载干净的可能会导致注册表出现问题。

但应该不是脚本的问题。。。。

参考OSError: [WinError 193] %1 is not a valid Win32 application

可能需要将lib/python3.8/subprocess.py Popen.__init__的 735 行的shell=False改成shell=True虽然这个方法很不好

shell改成了True,确实没有这个OSError,但好是跑不下去。

2021-05-22 15:56:05 INFO 结束运行 Traceback (most recent call last):
File "D:\Program Files\JDBrandMember-main\main.py", line 90, in get_browser
options=options)
File "C:\Python37\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init
self.service.start()
File "C:\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 98, in start
self.assert_process_still_running()
File "C:\Python37\lib\site-packages\selenium\webdriver\common\service.py", line 111, in assert_process_still_running
% (self.path, return_code)
selenium.common.exceptions.WebDriverException: Message: Service D:\Program Files\JDBrandMember-main\drivers/chromedriver unexpectedly exited. Status code was: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Program Files\JDBrandMember-main\main.py", line 391, in
main()
File "D:\Program Files\JDBrandMember-main\main.py", line 343, in main
check_user()
File "D:\Program Files\JDBrandMember-main\main.py", line 303, in check_user
_browser = get_browser()
File "D:\Program Files\JDBrandMember-main\main.py", line 94, in get_browser
raise WebDriverException
selenium.common.exceptions.WebDriverException: Message: None

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

Microsoft Windows [版本 10.0.19041.264]
(c) 2020 Microsoft Corporation. 保留所有权利。

C:\Windows\system32>ftype Python.File
Python.File="C:\Windows\py.exe" "%L" %*

C:\Windows\system32>

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

也是没有装别的,我是百度在CNDS看到很多这个错误提示,但是没有和这个一样的,至于你说的配置文件里面没有填是留空的,如果填上chrome的路径的话,就会报另外一种错 2021-05-22 20:33:53 ”ERROR CONFIG错误 请重新打开程序“

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

{
"thread": 6,
"binary": "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
"headless": true,
"useUser": 0,
"threshold": 0,
"is_get_voucher": true,
"users": []
}

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

配置文件是这样填的,不知道对不对
如果填了路径就报 ERROR CONFIG错误 请重新打开程序

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\python.exe C:/Users/Yang/Desktop/JDBrandMember-main/main.py
Traceback (most recent call last):
File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 355, in
config = json.load(open(get_file_path("config.json"), "r"))
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json_init_.py", line 293, in load
return loads(fp.read(),
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json_init_.py", line 346, in loads
return default_decoder.decode(s)
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=w(s, 0).end())
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 3 column 18 (char 36)
Traceback (most recent call last):
File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 355, in
config = json.load(open(get_file_path("config.json"), "r"))
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json_init
.py", line 293, in load
return loads(fp.read(),
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json_init
.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\Yang\AppData\Local\Programs\Python\Python39-32\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 3 column 18 (char 36)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Yang\Desktop\JDBrandMember-main\main.py", line 359, in
os.remove(get_file_path("config.json"))
PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:/Users/Yang/Desktop/JDBrandMember-main\config.json'

Process finished with exit code 1
用PYcharm运行是这样的结果,日志LOG里面是 2021-05-22 20:33:53 ERROR CONFIG错误 请重新打开程序

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

其实是没有程序在使用config.json这个文件,重启电脑再直接运行也是一样的提示,所以来这样找大神了

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

Microsoft Windows [版本 10.0.19041.264]
(c) 2020 Microsoft Corporation. 保留所有权利。

C:\Windows\system32>pip uninstall anaconda
WARNING: Skipping anaconda as it is not installed.

C:\Windows\system32>
提示没有装所谓的anaconda

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

报错,就是不弹出来登陆界面

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

报错,就是不弹出来登陆界面

应该是selenium本身的问题😂,,我也无能为力。

不过你可以有两种解决方法:

  1. 使用python虚拟环境
  2. 使用打包好的,打包使用的是pyinstaller和直接运行无异

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

2021-05-23 13:49:40 INFO 结束运行 Traceback (most recent call last):
File "selenium\webdriver\common\service.py", line 72, in start
File "subprocess.py", line 951, in init
File "subprocess.py", line 1420, in _execute_child
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\jd\main.py", line 89, in get_browser
return webdriver.Chrome(executable_path=get_file_path("drivers/chromedriver"), desired_capabilities={},
File "selenium\webdriver\chrome\webdriver.py", line 73, in init
File "selenium\webdriver\common\service.py", line 81, in start
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\jd\main.py", line 391, in
main()
File "C:\jd\main.py", line 341, in main
add_cookie()
File "C:\jd\main.py", line 102, in add_cookie
browser = get_browser(False)
File "C:\jd\main.py", line 94, in get_browser
raise WebDriverException
selenium.common.exceptions.WebDriverException: Message: None

使用打包好的也是这样的

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

github.com/curtinlv/JD-Script这个库可以运行,也可以刷豆,效果不错,就是不知道能不能天天刷

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

我知道是为什么会报错了,现在告诉大家,以避免大家和我一样走弯路,我是用了github.com/curtinlv/JD-Script这个脚本受了启发,发现这个getJDCookie.py脚本要一个EXE的文件chromedriver.exe,其实这个文件 库主“AntonVanke”文件里面就自带一个,但是是没有后缀名exe的,我就自作聪明的把库主自带的文件大小为16331KB的文件名改成 了chromedriver.exe,再试运行还是不行不弹出登陆界面,后来到https://npm.taobao.org/mirrors/chromedriver/90.0.4430.24/下载chromedriver_win32.zip 解压后替换库主原来的chromedriver,把扩展名去掉,再次运行就可以弹出登陆界面了,至此问题解决了,还有一个疑问就是我下载的那个文件的版本和我电脑的chrome浏览器的版本是不一致的,我是看到库主AntonVanke说自带的文件只适用于版本 90.0.4430.212,刚好我的就是这个版本就没有下载替换,导致弯了一大圈,现在的疑问是版本不一致也可以弹出登陆,真是奇怪,不过问题解决了,感谢库主一直耐心的解答,谢谢大家

from jdbrandmember.

lanyucomputer avatar lanyucomputer commented on July 2, 2024

验证账号1中,中途退出可能会误认为账号失效而删除

如果需要退出,请 ctrl + c 输入 3 退出,否则可能本次运行的结果不会保存
用户列表 用户名 京豆数量 是否在执行列表
1 jd_18888888888888 3944 1
选择

  1. 开始执行
  2. 添加账号
  3. 退出

1
当前账号:jd_18888888888888
正在执行:0.48925%[->****************************************]状态:在10215768号店铺获得2京豆豆
如果需要退出,请 ctrl + c 输入 3 退出,否则可能本次运行的结果不会保存
用户列表 用户名 京豆数量 是否在执行列表
1 jd_18888888888888 3944 1
选择

  1. 开始执行
  2. 添加账号
  3. 退出

3
日志已生成,查看./logs/ Some log data is being generated: ./log/ ...正在关闭,不要退出

from jdbrandmember.

AntonVanke avatar AntonVanke commented on July 2, 2024

我知道是为什么会报错了,现在告诉大家,以避免大家和我一样走弯路,我是用了github.com/curtinlv/JD-Script这个脚本受了启发,发现这个getJDCookie.py脚本要一个EXE的文件chromedriver.exe,其实这个文件 库主“AntonVanke”文件里面就自带一个,但是是没有后缀名exe的,我就自作聪明的把库主自带的文件大小为16331KB的文件名改成 了chromedriver.exe,再试运行还是不行不弹出登陆界面,后来到https://npm.taobao.org/mirrors/chromedriver/90.0.4430.24/下载chromedriver_win32.zip 解压后替换库主原来的chromedriver,把扩展名去掉,再次运行就可以弹出登陆界面了,至此问题解决了,还有一个疑问就是我下载的那个文件的版本和我电脑的chrome浏览器的版本是不一致的,我是看到库主AntonVanke说自带的文件只适用于版本 90.0.4430.212,刚好我的就是这个版本就没有下载替换,导致弯了一大圈,现在的疑问是版本不一致也可以弹出登陆,真是奇怪,不过问题解决了,感谢库主一直耐心的解答,谢谢大家


十分感谢,原来是没有下载对应驱动导致的

我误以为你已经下载好对应的驱动了。

内置的驱动是我开发环境所用的驱动,可能会造成误解。

Chrome驱动下载地址

JDBrandMember README.md

from jdbrandmember.

Related Issues (20)

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.